mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-17 05:45:05 +00:00
7011859: java/util/concurrent/Semaphore/RacingReleases.java failing
Reviewed-by: alanb, dholmes
This commit is contained in:
parent
5c2cfd8db4
commit
2acaedb538
@ -489,7 +489,8 @@ public abstract class AbstractQueuedLongSynchronizer
|
||||
/*
|
||||
* Try to signal next queued node if:
|
||||
* Propagation was indicated by caller,
|
||||
* or was recorded (as h.waitStatus) by a previous operation
|
||||
* or was recorded (as h.waitStatus either before
|
||||
* or after setHead) by a previous operation
|
||||
* (note: this uses sign-check of waitStatus because
|
||||
* PROPAGATE status may transition to SIGNAL.)
|
||||
* and
|
||||
@ -501,7 +502,8 @@ public abstract class AbstractQueuedLongSynchronizer
|
||||
* racing acquires/releases, so most need signals now or soon
|
||||
* anyway.
|
||||
*/
|
||||
if (propagate > 0 || h == null || h.waitStatus < 0) {
|
||||
if (propagate > 0 || h == null || h.waitStatus < 0 ||
|
||||
(h = head) == null || h.waitStatus < 0) {
|
||||
Node s = node.next;
|
||||
if (s == null || s.isShared())
|
||||
doReleaseShared();
|
||||
|
||||
@ -711,7 +711,8 @@ public abstract class AbstractQueuedSynchronizer
|
||||
/*
|
||||
* Try to signal next queued node if:
|
||||
* Propagation was indicated by caller,
|
||||
* or was recorded (as h.waitStatus) by a previous operation
|
||||
* or was recorded (as h.waitStatus either before
|
||||
* or after setHead) by a previous operation
|
||||
* (note: this uses sign-check of waitStatus because
|
||||
* PROPAGATE status may transition to SIGNAL.)
|
||||
* and
|
||||
@ -723,7 +724,8 @@ public abstract class AbstractQueuedSynchronizer
|
||||
* racing acquires/releases, so most need signals now or soon
|
||||
* anyway.
|
||||
*/
|
||||
if (propagate > 0 || h == null || h.waitStatus < 0) {
|
||||
if (propagate > 0 || h == null || h.waitStatus < 0 ||
|
||||
(h = head) == null || h.waitStatus < 0) {
|
||||
Node s = node.next;
|
||||
if (s == null || s.isShared())
|
||||
doReleaseShared();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user