看板 [ java ]
討論串一個關於thread的問題
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者sensibility (XD)時間19年前 (2006/07/15 02:09), 編輯資訊
0
0
0
內容預覽:
沒有 thread 在 bb 的 waiting list 裡面,該 wait() 並不是 bb 的,. 所以有沒有呼叫 notify 或 notifyAll 當然都一樣。. 後兩個 thread 會 block 住是因為都 synchronized 了 bb 的 instance。. --.

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者oishii (喔帥)時間19年前 (2006/07/13 23:13), 編輯資訊
0
0
0
內容預覽:
有一程式碼如下. public class A extends Thread{. B b;. public A (B bb){. b = bb;. }. public void run(){. synchronized(b){. try{. wait();. } catch (Interruptio
(還有535個字)
首頁
上一頁
1
下一頁
尾頁