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.29 by jsr166, Thu Aug 6 15:13:54 2009 UTC vs.
Revision 1.30 by jsr166, Tue Oct 6 19:02:48 2009 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines