0
有没有办法让一个线程启动一个新线程来等待它启动的线程停止了?我正在考虑使用锁定,但如果线程崩溃,锁将永远不会释放。Java线程同步
所以当我的程序调用
cTurnCardOvrerConnection thread = new cTurnCardOvrerConnection("thread3", connection, mPlayerList, mPlayersMessages, lBoard);
将它等到线程结束?
mPlayerList.WaitForAllPlayers();
do
{
do
{
r=GetClient();
switch(r)
{
case 0: return; // exitvon a very bad error
}
} while(r==2); // loop if it was a timeout wait for this thread to terminate.
cTurnCardOvrerConnection thread = new cTurnCardOvrerConnection("thread3", connection, mPlayerList, mPlayersMessages, lBoard);
if (CheckTimeStamp())
break;
} while(mPlayerList.AllPlayersFinished()==false);
嗨,起初我想做多线程for – 2012-02-16 00:43:32