src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java
changeset 55035 3a30c73838f6
parent 53780 d04f72c354e9
equal deleted inserted replaced
55034:f46be958c4ac 55035:3a30c73838f6
   865                 top = s + 1;
   865                 top = s + 1;
   866                 if (d == m)
   866                 if (d == m)
   867                     growArray(true);
   867                     growArray(true);
   868                 else {
   868                 else {
   869                     phase = 0; // full volatile unlock
   869                     phase = 0; // full volatile unlock
   870                     if (a[m & (s - 1)] == null)
   870                     if (((s - base) & ~1) == 0) // size 0 or 1
   871                         signal = true;   // was empty
   871                         signal = true;
   872                 }
   872                 }
   873             }
   873             }
   874             return signal;
   874             return signal;
   875         }
   875         }
   876 
   876 
  2665             }
  2665             }
  2666         }
  2666         }
  2667     }
  2667     }
  2668 
  2668 
  2669     /**
  2669     /**
  2670      * Returns an estimate of the total number of tasks stolen from
  2670      * Returns an estimate of the total number of completed tasks that
  2671      * one thread's work queue by another. The reported value
  2671      * were executed by a thread other than their submitter. The
  2672      * underestimates the actual total number of steals when the pool
  2672      * reported value underestimates the actual total number of steals
  2673      * is not quiescent. This value may be useful for monitoring and
  2673      * when the pool is not quiescent. This value may be useful for
  2674      * tuning fork/join programs: in general, steal counts should be
  2674      * monitoring and tuning fork/join programs: in general, steal
  2675      * high enough to keep threads busy, but low enough to avoid
  2675      * counts should be high enough to keep threads busy, but low
  2676      * overhead and contention across threads.
  2676      * enough to avoid overhead and contention across threads.
  2677      *
  2677      *
  2678      * @return the number of steals
  2678      * @return the number of steals
  2679      */
  2679      */
  2680     public long getStealCount() {
  2680     public long getStealCount() {
  2681         long count = stealCount;
  2681         long count = stealCount;