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