Skip to content

Commit 3f554d4

Browse files
author
Dmitry Chuyko
committed
8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool
Reviewed-by: dl, alanb, liach
1 parent 9ad87a9 commit 3f554d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,8 @@ private int tryTrim(WorkQueue w, int phase, long deadline) {
20772077
else if (deadline - System.currentTimeMillis() >= TIMEOUT_SLOP)
20782078
stat = 0; // spurious wakeup
20792079
else if (!compareAndSetCtl(
2080-
c, nc = (w.stackPred & LMASK) | (UMASK & (c - TC_UNIT))))
2080+
c, nc = ((w.stackPred & LMASK) | (RC_MASK & c) |
2081+
(TC_MASK & (c - TC_UNIT)))))
20812082
stat = -1; // lost race to signaller
20822083
else {
20832084
stat = 1;

0 commit comments

Comments
 (0)