ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/ForkJoinPool.java
(Generate patch)

Comparing jsr166/src/jsr166y/ForkJoinPool.java (file contents):
Revision 1.99 by dl, Wed Mar 23 11:27:43 2011 UTC vs.
Revision 1.100 by dl, Fri Apr 1 20:20:37 2011 UTC

# Line 762 | Line 762 | public class ForkJoinPool extends Abstra
762  
763      /**
764       * Tries to enqueue worker w in wait queue and await change in
765 <     * worker's eventCount.  If the pool is quiescent, possibly
766 <     * terminates worker upon exit.  Otherwise, before blocking,
767 <     * rescans queues to avoid missed signals.  Upon finding work,
768 <     * releases at least one worker (which may be the current
769 <     * worker). Rescans restart upon detected staleness or failure to
770 <     * release due to contention. Note the unusual conventions about
771 <     * Thread.interrupt here and elsewhere: Because interrupts are
772 <     * used solely to alert threads to check termination, which is
773 <     * checked here anyway, we clear status (using Thread.interrupted)
774 <     * before any call to park, so that park does not immediately
775 <     * return due to status being set via some other unrelated call to
776 <     * interrupt in user code.
765 >     * worker's eventCount.  If the pool is quiescent and there is
766 >     * more than one worker, possibly terminates worker upon exit.
767 >     * Otherwise, before blocking, rescans queues to avoid missed
768 >     * signals.  Upon finding work, releases at least one worker
769 >     * (which may be the current worker). Rescans restart upon
770 >     * detected staleness or failure to release due to
771 >     * contention. Note the unusual conventions about Thread.interrupt
772 >     * here and elsewhere: Because interrupts are used solely to alert
773 >     * threads to check termination, which is checked here anyway, we
774 >     * clear status (using Thread.interrupted) before any call to
775 >     * park, so that park does not immediately return due to status
776 >     * being set via some other unrelated call to interrupt in user
777 >     * code.
778       *
779       * @param w the calling worker
780       * @param c the ctl value on entry
# Line 794 | Line 795 | public class ForkJoinPool extends Abstra
795              else if (w.eventCount != v)
796                  return true;                      // update next time
797          }
798 <        if (parallelism + (int)(nc >> AC_SHIFT) == 0 &&
798 >        if ((int)c != 0 && parallelism + (int)(nc >> AC_SHIFT) == 0 &&
799              blockedCount == 0 && quiescerCount == 0)
800              idleAwaitWork(w, nc, c, v);           // quiescent
801          for (boolean rescanned = false;;) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines