Skip to content

Commit 8a13967

Browse files
Dmitry ChuykoPaul Hohensee
authored andcommitted
8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool
Reviewed-by: phh, dl
1 parent 78b8b24 commit 8a13967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ else if (rc <= 0 && (md & SHUTDOWN) != 0 &&
16141614
tryTerminate(false, false))
16151615
break; // quiescent shutdown
16161616
else if (rc <= 0 && pred != 0 && phase == (int)c) {
1617-
long nc = (UC_MASK & (c - TC_UNIT)) | (SP_MASK & pred);
1617+
long nc = (RC_MASK & c) | (TC_MASK & (c - TC_UNIT)) | (SP_MASK & pred);
16181618
long d = keepAlive + System.currentTimeMillis();
16191619
LockSupport.parkUntil(this, d);
16201620
if (ctl == c && // drop on timeout if all idle

0 commit comments

Comments
 (0)