Files
openide/java/java-impl/resources/inspectionDescriptions/SleepWhileHoldingLock.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

19 lines
519 B
HTML

<html>
<body>
Reports calls to <code>java.lang.Thread.sleep()</code> methods that occur
within a <code>synchronized</code> block or method.
<p>
<code>sleep()</code> within a
<code>synchronized</code> block may result in decreased performance, poor scalability, and possibly
even deadlocking. Consider using <code>wait()</code> instead,
as it will release the lock held.
</p>
<p><b>Example:</b></p>
<pre><code>
synchronized (lock) {
Thread.sleep(100);
}
</code></pre>
<!-- tooltip end -->
</body>
</html>