Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
Mutex.tryLock()
non-linearizability (Kotlin#3781)
The scenario in question: - tryLock(owner), but the mutex was locked with the same owner - tryAcquire() fails - another thread releases the mutex - holdsLock(owner) fails, as the mutex is unlocked - another thread acquires the mutex with owner - isLocked returns true, and tryLock(owner) returns false. However, tryLock(o) should throw an exception. Fixes Kotlin#3745 Signed-off-by: Nikita Koval <[email protected]> Co-authored-by: Vsevolod Tolstopyatov <[email protected]>
- Loading branch information