Skip to content

Commit e13da98

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

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
@@ -1760,7 +1760,7 @@ private boolean tryTrim(WorkQueue w) {
17601760
int sp = (int)c & ~INACTIVE;
17611761
if ((sp & SMASK) == (cfg & SMASK) &&
17621762
compareAndSetCtl(c, ((pred & SP_MASK) |
1763-
(UC_MASK & (c - TC_UNIT))))) {
1763+
(c & RC_MASK) | ((c - TC_UNIT) & TC_MASK)))) {
17641764
w.config = cfg; // add sentinel for deregisterWorker
17651765
w.phase = sp;
17661766
return true;

0 commit comments

Comments
 (0)