intertupt(), interrupted()和isInterrupted()區別

interrupt()用來更改中斷狀態位,設置爲true,並且拋出InterruptedException異常,之後reset中斷狀態位爲true,具體如何中斷的這個行爲得自己在catch()裏實現,例子如下: interrupted()和isInterrupted()區別如下: 後者爲Thead類的靜態函數
相關文章
相關標籤/搜索