Android Gameloop线程。join()挂起应用程序
嘿,我正在实现这里的gameloop: 我的问题是为什么有:Android Gameloop线程。join()挂起应用程序,android,multithreading,loops,frame-rate,Android,Multithreading,Loops,Frame Rate,嘿,我正在实现这里的gameloop: 我的问题是为什么有: boolean retry = true; while (retry) { try { thread.join(); retry = false; } catch (InterruptedException e) { // try again shutting down the thread }
boolean retry = true;
while (retry) {
try {
thread.join();
retry = false;
} catch (InterruptedException e) {
// try again shutting down the thread
}
}
在我的游戏视图的my surfaceDestroyed()函数中,挂起应用程序?
线程。join()
将阻止,直到您加入的线程完成。如果该线程从未完成,则该函数将永远不会释放。因为thread.join()
会在线程完成之前阻止调用线程。谢谢!我忘了我必须中断线程中包含的while循环>>