[問題] thread強制停止後怎麼繼續執行?

看板java作者 (傑)時間14年前 (2011/03/16 16:05), 編輯推噓0(006)
留言6則, 4人參與, 最新討論串1/1
程式碼大概如下 try{ Thread.sleep(1000000); }catch (InterruptedException e){ System.out.println("test END"); } 黃色部分讓Thread睡覺是為了等待JAVA做類似常駐程式event-driven的事 但是讓程式強制停止後如何繼續執行印出的事?? @@ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.119.19.138

03/16 16:11, , 1F
keyword: wait
03/16 16:11, 1F

03/16 16:12, , 2F
恩 我查察
03/16 16:12, 2F

03/16 16:46, , 3F
嗯 還是不太懂 thread
03/16 16:46, 3F

03/17 19:47, , 4F
可以讓別的 thread 來 interrupt停在blocking operation
03/17 19:47, 4F

03/17 19:56, , 5F
的 thread 以離開 blocking 狀態。
03/17 19:56, 5F

03/18 23:28, , 6F
notify?
03/18 23:28, 6F
文章代碼(AID): #1DW6zXsS (java)