About wait (), notify (), notifyall () Precautions

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_44675837/article/details/102765701

1.wait (), notify (), notifyall () method is called three must be synchronized block synchronization or synchronization monitor method, there would be an abnormal IllegalMonitorStateException

2.三个方法必须使用在同步代码块或同步方法中


3.三个方法都声明在java.lang.object类中

Guess you like

Origin blog.csdn.net/qq_44675837/article/details/102765701