From ae0b26613cfa901b8eccea9b362a14b1517aa301 Mon Sep 17 00:00:00 2001
From: Doug Lea
Date: Fri, 24 May 2019 08:51:04 -0700
Subject: [PATCH] 8220478: java/util/concurrent/ConcurrentHashMap/ToArray.java
timed out intermittently 8223379: Clarify ForkJoinPool.getStealCount()
javadoc
Reviewed-by: martin
---
.../java/util/concurrent/ForkJoinPool.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java b/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java
index ac6d253ae56..bd54868e6fd 100644
--- a/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java
+++ b/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java
@@ -867,8 +867,8 @@ public class ForkJoinPool extends AbstractExecutorService {
growArray(true);
else {
phase = 0; // full volatile unlock
- if (a[m & (s - 1)] == null)
- signal = true; // was empty
+ if (((s - base) & ~1) == 0) // size 0 or 1
+ signal = true;
}
}
return signal;
@@ -2667,13 +2667,13 @@ public class ForkJoinPool extends AbstractExecutorService {
}
/**
- * Returns an estimate of the total number of tasks stolen from
- * one thread's work queue by another. The reported value
- * underestimates the actual total number of steals when the pool
- * is not quiescent. This value may be useful for monitoring and
- * tuning fork/join programs: in general, steal counts should be
- * high enough to keep threads busy, but low enough to avoid
- * overhead and contention across threads.
+ * Returns an estimate of the total number of completed tasks that
+ * were executed by a thread other than their submitter. The
+ * reported value underestimates the actual total number of steals
+ * when the pool is not quiescent. This value may be useful for
+ * monitoring and tuning fork/join programs: in general, steal
+ * counts should be high enough to keep threads busy, but low
+ * enough to avoid overhead and contention across threads.
*
* @return the number of steals
*/