wait/notify/notifyAll實現線程間通信

轉載請註明出處:http://blog.csdn.net/ns_code/article/details/17225469    在Java中,可以通過配合調用Object對象的wait()方法和notify()方法或notifyAll()方法來實現線程間的通信。在線程中調用wait()方法,將阻塞等待其他線程的通知(其他線程調用notify()方法或notifyAll()方法),在線程中調用no
相關文章
相關標籤/搜索