作者swenj (傑)
看板java
標題[問題] thread強制停止後怎麼繼續執行?
時間Wed Mar 16 16:05:51 2011
程式碼大概如下
try{
Thread.sleep(1000000);
}catch (InterruptedException e){
System.out.println("test END");
}
黃色部分讓Thread睡覺是為了等待JAVA做類似常駐程式event-driven的事
但是讓程式強制停止後如何繼續執行印出的事??
@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.119.19.138
→ tkcn:keyword: wait 03/16 16:11
→ swenj:恩 我查察 03/16 16:12
→ swenj:嗯 還是不太懂 thread 03/16 16:46
→ sbrhsieh:可以讓別的 thread 來 interrupt停在blocking operation 03/17 19:47
→ sbrhsieh:的 thread 以離開 blocking 狀態。 03/17 19:56
→ gmoz:notify? 03/18 23:28