forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use JDK Condition.await for Mutex sleep.
Previous logic used the same semaphore to sleep as any other sleep which interfered with code that expected the Mutex to be the lock used. The new logic uses the Mutex's JDK Lock, via a Condition, to do the sleeping. Because it is not possible for us to change the artificial thread status we maintain to "sleep" after the lock is released, this modified logic also introduces a new thread state that indicates that the native JDK thread state should be used. This gets closer to avoiding the racing status. It does not appear to eliminate the race altogether. Fixes jruby#5863.
- Loading branch information
Showing
1 changed file
with
55 additions
and
15 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