AndEngine icon indicating copy to clipboard operation
AndEngine copied to clipboard

Nested runOnUpdateThread runnables lost.

Open vlaaad opened this issue 12 years ago • 0 comments

Code

getEngine().runOnUpdateThread(new Runnable () {
    @Override
    public void run() {
        Log.d("Test", "runnable a");
        getEngine().runOnUpdateThread(new Runnable () {
                @Override
                public void run() {
                    Log.d("Test", "runnable b");
                }
        });
    }
});

produces output

runnable a

instead of

runnable a
runnable b

My workaround: in Engine::runOnUpdateThread I added:

if (Thread.currentThread.equals(mUpdateThread)) {
    runnable.run();
} else ...

Is it a real bug, or I am doing something wrong?

P.S. Sorry for my bad english.

vlaaad avatar May 31 '13 08:05 vlaaad