线程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
相关文章
相关标签/搜索