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

Comparing jsr166/src/jsr166y/ForkJoinWorkerThread.java (file contents):
Revision 1.9 by jsr166, Mon Jul 20 22:26:03 2009 UTC vs.
Revision 1.10 by jsr166, Mon Jul 20 23:07:43 2009 UTC

# Line 44 | Line 44 | public class ForkJoinWorkerThread extend
44       * of tasks. To accomplish this, we shift the CAS arbitrating pop
45       * vs deq (steal) from being on the indices ("base" and "sp") to
46       * the slots themselves (mainly via method "casSlotNull()"). So,
47 <     * both a successful pop and deq mainly entail CAS'ing a nonnull
47 >     * both a successful pop and deq mainly entail CAS'ing a non-null
48       * slot to null.  Because we rely on CASes of references, we do
49       * not need tag bits on base or sp.  They are simple ints as used
50       * in any circular array-based queue (see for example ArrayDeque).
# Line 400 | Line 400 | public class ForkJoinWorkerThread extend
400      // Intrinsics-based support for queue operations.
401  
402      /**
403 <     * Add in store-order the given task at given slot of q to
404 <     * null. Caller must ensure q is nonnull and index is in range.
403 >     * Adds in store-order the given task at given slot of q to null.
404 >     * Caller must ensure q is non-null and index is in range.
405       */
406      private static void setSlot(ForkJoinTask<?>[] q, int i,
407                                  ForkJoinTask<?> t){
# Line 409 | Line 409 | public class ForkJoinWorkerThread extend
409      }
410  
411      /**
412 <     * CAS given slot of q to null. Caller must ensure q is nonnull
412 >     * CAS given slot of q to null. Caller must ensure q is non-null
413       * and index is in range.
414       */
415      private static boolean casSlotNull(ForkJoinTask<?>[] q, int i,
# Line 428 | Line 428 | public class ForkJoinWorkerThread extend
428  
429      /**
430       * Pushes a task. Called only by current thread.
431 <     * @param t the task. Caller must ensure nonnull
431 >     * @param t the task. Caller must ensure non-null.
432       */
433      final void pushTask(ForkJoinTask<?> t) {
434          ForkJoinTask<?>[] q = queue;
# Line 464 | Line 464 | public class ForkJoinWorkerThread extend
464  
465      /**
466       * Returns a popped task, or null if empty. Ensures active status
467 <     * if nonnull. Called only by current thread.
467 >     * if non-null. Called only by current thread.
468       */
469      final ForkJoinTask<?> popTask() {
470          int s = sp;
# Line 487 | Line 487 | public class ForkJoinWorkerThread extend
487       * Specialized version of popTask to pop only if
488       * topmost element is the given task. Called only
489       * by current thread while active.
490 <     * @param t the task. Caller must ensure nonnull
490 >     * @param t the task. Caller must ensure non-null
491       */
492      final boolean unpushTask(ForkJoinTask<?> t) {
493          ForkJoinTask<?>[] q = queue;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines