首頁 文章 Object 对象的方法

Object 对象的方法

2024-09-13 22:32  瀏覽數:171  來源:redjujubee    

public final void wait() throws InterruptedException
Causes the current thread to wait until it is awakened, typically by being notified or
interrupted.
public final void notifyAll()
Wakes up all threads that are waiting on this object's monitor. A thread waits on an
object's monitor by calling one of the wait methods.
The awakened threads will not be able to proceed until the current thread relinquishes the
lock on this object. The awakened threads will compete in the usual manner with any other
threads that might be actively competing to synchronize on this object; for example, the
awakened threads enjoy no reliable privilege or disadvantage in being the next thread to
lock this object.
This method should only be called by a thread that is the owner of this object's monitor.



聲明:以上文章均為用戶自行添加,僅供打字交流使用,不代表本站觀點,本站不承擔任何法律責任,特此聲明!如果有侵犯到您的權利,請及時聯系我們刪除。

字符:    改为:
去打字就可以设置个性皮肤啦!(O ^ ~ ^ O)