File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
java/ql/src/Likely Bugs/Concurrency Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 66<overview >
77<p >
88When a thread acquires a lock it must make sure to unlock it again;
9- failing to do so can lead to deadlocks. If a lock allows a thread to acquire
9+ failing to do so can lead to deadlocks. If a lock allows a thread to acquire
1010it multiple times, for example <code >java.util.concurrent.locks.ReentrantLock</code >,
1111then the number of locks must match the number of unlocks in order to fully
1212release the lock.
@@ -17,7 +17,7 @@ release the lock.
1717<p >
1818It is recommended practice always to immediately follow a call to <code >lock</code >
1919with a <code >try</code > block and place the call to <code >unlock</code > inside the
20- <code >finally</code > block. Beware of calls inside the <code >finally</code > block
20+ <code >finally</code > block. Beware of calls inside the <code >finally</code > block
2121that could cause exceptions, as this may result in skipping the call to <code >unlock</code >.
2222</p >
2323</recommendation >
You can’t perform that action at this time.
0 commit comments