Search code examples
androidmultithreadingloopsframe-rate

Android Gameloop Thread.join() hangs application


Hey all i am implementing the gameloop found here: http://obviam.net/index.php/the-android-game-loop/

My question is why does having:

    boolean retry = true;
    while (retry) {
        try {
            thread.join();
            retry = false;
        } catch (InterruptedException e) {
            // try again shutting down the thread
        }
    }

In my surfaceDestroyed() function of my game view hang the application?


Solution

  • thread.join() will BLOCK until the thread you're joining completes. If that thread never completes, that function will never release.