mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
21 lines
484 B
HTML
21 lines
484 B
HTML
<html>
|
|
<body>
|
|
Reports nested <code>synchronized</code> statements.
|
|
It is recommended to avoid nested synchronization if possible, because in some cases it may lead to a deadlock.
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
synchronized (lockA){
|
|
//thread 1 is waiting for lockB
|
|
synchronized (lockB){ //warning
|
|
}
|
|
}
|
|
...
|
|
synchronized (lockB) {
|
|
//thread 2 is waiting for lockA
|
|
synchronized (lockA) { //warning
|
|
}
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
</body>
|
|
</html> |