/dalvik/tests/067-preemptive-unpark/src/ |
Main.java | 1 import sun.misc.Unsafe; 6 private static Unsafe UNSAFE; 16 UNSAFE.unpark(test); 40 * Set up {@link #UNSAFE}. 44 * Subvert the access check to get the unique Unsafe instance. 49 Field field = Unsafe.class.getDeclaredField("THE_ONE"); 52 UNSAFE = (Unsafe) field.get(null); 95 UNSAFE.park(false, 500 * 1000000); // 500 mse [all...] |
/libcore/luni/src/main/java/java/util/concurrent/atomic/ |
AtomicMarkableReference.java | 9 import sun.misc.Unsafe; 164 // Unsafe mechanics 166 private static final sun.misc.Unsafe UNSAFE = UnsafeAccess.THE_ONE; // android-changed 168 objectFieldOffset(UNSAFE, "pair", AtomicMarkableReference.class); 171 return UNSAFE.compareAndSwapObject(this, pairOffset, cmp, val); 174 static long objectFieldOffset(sun.misc.Unsafe UNSAFE, 177 return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
|
AtomicStampedReference.java | 163 // Unsafe mechanics 165 private static final sun.misc.Unsafe UNSAFE = UnsafeAccess.THE_ONE; // android-changed 167 objectFieldOffset(UNSAFE, "pair", AtomicStampedReference.class); 170 return UNSAFE.compareAndSwapObject(this, pairOffset, cmp, val); 173 static long objectFieldOffset(sun.misc.Unsafe UNSAFE, 176 return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
|
/libcore/luni/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/ |
ThreadsTest.java | 23 import sun.misc.Unsafe; 26 * Tests for the <code>park()</code> functionality of {@link Unsafe}. 29 private static Unsafe UNSAFE = null; 34 * Set up {@link #UNSAFE}. This subverts the access check to 35 * get the unique Unsafe instance. We can do this because 40 Field field = Unsafe.class.getDeclaredField("THE_ONE"); 43 UNSAFE = (Unsafe) field.get(null); 80 UNSAFE.unpark(parkerThread) [all...] |
/libcore/luni/src/main/java/java/util/concurrent/ |
SynchronousQueue.java | 217 UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); 230 UNSAFE.compareAndSwapObject(this, matchOffset, null, s)) { 245 UNSAFE.compareAndSwapObject(this, matchOffset, null, this); 252 // Unsafe mechanics 253 private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe(); 255 objectFieldOffset(UNSAFE, "next", SNode.class); 257 objectFieldOffset(UNSAFE, "match", SNode.class); 266 UNSAFE.compareAndSwapObject(this, headOffset, h, nh) [all...] |
ConcurrentLinkedQueue.java | 130 * for a volatile write to item by using Unsafe.putObject instead 151 UNSAFE.putObject(this, itemOffset, item); 155 return UNSAFE.compareAndSwapObject(this, itemOffset, cmp, val); 159 UNSAFE.putOrderedObject(this, nextOffset, val); 163 return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); 166 // Unsafe mechanics 168 private static final sun.misc.Unsafe UNSAFE = 169 sun.misc.Unsafe.getUnsafe(); 171 objectFieldOffset(UNSAFE, "next", Node.class) [all...] |
ConcurrentLinkedDeque.java | 275 UNSAFE.putObject(this, itemOffset, item); 279 return UNSAFE.compareAndSwapObject(this, itemOffset, cmp, val); 283 UNSAFE.putOrderedObject(this, nextOffset, val); 287 return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); 291 UNSAFE.putOrderedObject(this, prevOffset, val); 295 return UNSAFE.compareAndSwapObject(this, prevOffset, cmp, val); 298 // Unsafe mechanics 300 private static final sun.misc.Unsafe UNSAFE = 301 sun.misc.Unsafe.getUnsafe() [all...] |
PriorityBlockingQueue.java | 251 UNSAFE.compareAndSwapInt(this, allocationSpinLockOffset, 935 // Unsafe mechanics 936 private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe(); 938 objectFieldOffset(UNSAFE, "allocationSpinLock", 941 static long objectFieldOffset(sun.misc.Unsafe UNSAFE, [all...] |
ConcurrentSkipListMap.java | 352 return UNSAFE.compareAndSwapObject(this, headOffset, cmp, val); 395 return UNSAFE.compareAndSwapObject(this, valueOffset, cmp, val); 402 return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); 481 // Unsafe mechanics 482 private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe(); 484 objectFieldOffset(UNSAFE, "value", Node.class); 486 objectFieldOffset(UNSAFE, "next", Node.class); 517 return UNSAFE.compareAndSwapObject(this, rightOffset, cmp, val) [all...] |