Files
openide/java/java-impl/resources/inspectionDescriptions/NotifyCalledOnCondition.html
2025-02-05 04:43:28 +00:00

28 lines
717 B
HTML

<html>
<body>
Reports calls to <code>notify()</code> or <code>notifyAll()</code> made on
<code>java.util.concurrent.locks.Condition</code> object.
<p>
This is probably a programming error, and some variant of the <code>signal()</code> or
<code>signalAll()</code> method was intended instead, otherwise <code>IllegalMonitorStateException</code> may occur.
</p>
<p><b>Example:</b></p>
<pre><code>
class C {
final Lock l = new ReentrantLock();
final Condition c = l.newCondition();
void release() {
l.lock();
try {
c.notifyAll(); // probably 'signalAll()' was intended here
} finally {
l.unlock();
}
}
}
</code></pre>
<!-- tooltip end -->
</body>
</html>