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

Comparing jsr166/src/main/java/util/concurrent/ForkJoinWorkerThread.java (file contents):
Revision 1.9 by jsr166, Wed Aug 12 04:10:59 2009 UTC vs.
Revision 1.10 by jsr166, Tue Oct 6 19:02:48 2009 UTC

# Line 413 | Line 413 | public class ForkJoinWorkerThread extend
413  
414      // Intrinsics-based support for queue operations.
415  
416 +    private static long slotOffset(int i) {
417 +        return ((long) i << qShift) + qBase;
418 +    }
419 +
420      /**
421       * Adds in store-order the given task at given slot of q to null.
422       * Caller must ensure q is non-null and index is in range.
423       */
424      private static void setSlot(ForkJoinTask<?>[] q, int i,
425                                  ForkJoinTask<?> t) {
426 <        UNSAFE.putOrderedObject(q, (i << qShift) + qBase, t);
426 >        UNSAFE.putOrderedObject(q, slotOffset(i), t);
427      }
428  
429      /**
# Line 428 | Line 432 | public class ForkJoinWorkerThread extend
432       */
433      private static boolean casSlotNull(ForkJoinTask<?>[] q, int i,
434                                         ForkJoinTask<?> t) {
435 <        return UNSAFE.compareAndSwapObject(q, (i << qShift) + qBase, t, null);
435 >        return UNSAFE.compareAndSwapObject(q, slotOffset(i), t, null);
436      }
437  
438      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines