線程wait和notify報錯java.lang.IllegalMonitorStateException

本質上就是:sleep是Thread類的方法,wait是Object類中定義的方法 JavaDoc中說到: A thread becomes the owner of the object's monitor in one of three ways: 1. By executing a synchronized instance method of that object. 2. By exec
相關文章
相關標籤/搜索