Skip to content

Commit

Permalink
reentrant unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
Roiocam committed Aug 16, 2024
1 parent 9d83af3 commit ac62cce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/lettuce/core/protocol/SharedLock.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private void lockWritersExclusive() {
private void unlockWritersExclusive() {

if (exclusiveLockOwner == Thread.currentThread()) {
if (WRITERS.incrementAndGet(this) == 0) {
if (WRITERS.compareAndSet(this, -1, 0)) {
exclusiveLockOwner = null;
}
}
Expand Down

0 comments on commit ac62cce

Please sign in to comment.