-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential double acquisition in
SingleLock
`SingleLock` uses a `ForkJoinPool.ManagedBlocker` for efficient blocking in a fork-join pool. In the `isReleasable()` method it calls `tryLock()` without remembering the outcome. The `block` method also unconditionally called `lockInterruptibly()` even if the lock was already acquired. The problem that can arise is that the lock is acquired multiple times, but only released once. `CompositeLockManagedBlocker` is also updated, so that `block()` checks for `acquired` before locking.
- Loading branch information
1 parent
bc87b07
commit efdb8cf
Showing
3 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters