Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit 55bb58e

Browse files
committed
consistent use of "Object lock = workerNamePrefix"
1 parent b3db834 commit 55bb58e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/java9/util/concurrent/ForkJoinPool.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,8 +1441,9 @@ final WorkQueue registerWorker(ForkJoinWorkerThread wt) {
14411441
int tid = 0; // for thread name
14421442
int fifo = mode & FIFO;
14431443
String prefix = workerNamePrefix;
1444-
if (prefix != null) {
1445-
synchronized (prefix) {
1444+
Object lock = prefix;
1445+
if (lock != null) {
1446+
synchronized (lock) {
14461447
WorkQueue[] ws = workQueues; int n;
14471448
int s = indexSeed += SEED_INCREMENT;
14481449
if (ws != null && (n = ws.length) > 1) {

0 commit comments

Comments
 (0)