开发者

Android Gameloop Thread.join() hangs application

开发者 https://www.devze.com 2023-02-18 00:45 出处:网络
Hey all i am implementing the gameloop found here: http://obviam.net/index.php/the-android-game-loop/

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 su开发者_Go百科rfaceDestroyed() function of my game view hang the application?


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


Because thread.join() blocks the calling thread until thread is done.

0

精彩评论

暂无评论...
验证码 换一张
取 消