/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/ |
ConcurrentLinkedQueue.java | 137 * for a volatile write to item by using Unsafe.putObject instead 158 UNSAFE.putObject(this, itemOffset, item); 162 return UNSAFE.compareAndSwapObject(this, itemOffset, cmp, val); 166 UNSAFE.putOrderedObject(this, nextOffset, val); 170 return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); 173 // Unsafe mechanics 175 private static final sun.misc.Unsafe UNSAFE; 181 UNSAFE = sun.misc.Unsafe.getUnsafe() [all...] |
ConcurrentSkipListSet.java | 446 UNSAFE.putObjectVolatile(this, mapOffset, map); 449 private static final sun.misc.Unsafe UNSAFE; 453 UNSAFE = sun.misc.Unsafe.getUnsafe(); 455 mapOffset = UNSAFE.objectFieldOffset
|
ForkJoinWorkerThread.java | 120 * on an uncomfortable amount of "Unsafe" mechanics. To maintain 132 * efficiently is to use direct Unsafe calls. (Using external 399 * intrinsic for arranging this, but using Unsafe putOrderedInt 412 return UNSAFE.compareAndSwapObject(q, (i << ASHIFT) + ABASE, t, null); 422 UNSAFE.putObjectVolatile(q, (i << ASHIFT) + ABASE, t); 436 UNSAFE.putOrderedObject(q, u, t); 464 Object x = UNSAFE.getObjectVolatile(oldQ, u); 465 if (x != null && UNSAFE.compareAndSwapObject(oldQ, u, x, null)) 466 UNSAFE.putObjectVolatile 485 UNSAFE.compareAndSwapObject(q, (i << ASHIFT) + ABASE, t, null)) [all...] |
FutureTask.java | 44 * AtomicXFieldUpdaters and instead directly use Unsafe intrinsics. 140 if (!UNSAFE.compareAndSwapInt(this, stateOffset, NEW, INTERRUPTING)) 145 UNSAFE.putOrderedInt(this, stateOffset, INTERRUPTED); // final state 147 else if (!UNSAFE.compareAndSwapInt(this, stateOffset, NEW, CANCELLED)) 198 if (UNSAFE.compareAndSwapInt(this, stateOffset, NEW, COMPLETING)) { 200 UNSAFE.putOrderedInt(this, stateOffset, NORMAL); // final state 216 if (UNSAFE.compareAndSwapInt(this, stateOffset, NEW, COMPLETING)) { 218 UNSAFE.putOrderedInt(this, stateOffset, EXCEPTIONAL); // final state 225 !UNSAFE.compareAndSwapObject(this, runnerOffset, 267 !UNSAFE.compareAndSwapObject(this, runnerOffset [all...] |
ConcurrentLinkedDeque.java | 278 UNSAFE.putObject(this, itemOffset, item); 282 return UNSAFE.compareAndSwapObject(this, itemOffset, cmp, val); 286 UNSAFE.putOrderedObject(this, nextOffset, val); 290 return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); 294 UNSAFE.putOrderedObject(this, prevOffset, val); 298 return UNSAFE.compareAndSwapObject(this, prevOffset, cmp, val); 301 // Unsafe mechanics 303 private static final sun.misc.Unsafe UNSAFE; 310 UNSAFE = sun.misc.Unsafe.getUnsafe() [all...] |
Phaser.java | 364 if (UNSAFE.compareAndSwapLong(this, stateOffset, s, s-=adjust)) { 377 UNSAFE.compareAndSwapLong(this, stateOffset, s, n); 382 UNSAFE.compareAndSwapLong(this, stateOffset, 418 else if (UNSAFE.compareAndSwapLong(this, stateOffset, 425 if (UNSAFE.compareAndSwapLong(this, stateOffset, s, next)) 437 while (!UNSAFE.compareAndSwapLong 469 !UNSAFE.compareAndSwapLong 659 if (UNSAFE.compareAndSwapLong(this, stateOffset, s, 675 if (!UNSAFE.compareAndSwapLong(this, stateOffset, s, n)) [all...] |
ConcurrentHashMap.java | 81 * which is done via Unsafe within methods segmentAt etc 190 UNSAFE.putOrderedObject(this, nextOffset, n); 193 // Unsafe mechanics 194 static final sun.misc.Unsafe UNSAFE; 198 UNSAFE = sun.misc.Unsafe.getUnsafe(); 200 nextOffset = UNSAFE.objectFieldOffset 216 (HashEntry<K,V>) UNSAFE.getObjectVolatile 226 UNSAFE.putOrderedObject(tab, ((long)i << TSHIFT) + TBASE, e) [all...] |
ForkJoinTask.java | 211 if (UNSAFE.compareAndSwapInt(this, statusOffset, s, completion)) { 231 UNSAFE.compareAndSwapInt(this, statusOffset, 0, SIGNAL))) && 254 UNSAFE.compareAndSwapInt(this, statusOffset, 283 UNSAFE.compareAndSwapInt(this, statusOffset, [all...] |
LinkedTransferQueue.java | 416 * them after use. Relies heavily on Unsafe mechanics to minimize 428 return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); 433 return UNSAFE.compareAndSwapObject(this, itemOffset, cmp, val); 441 UNSAFE.putObject(this, itemOffset, item); // relaxed write 450 UNSAFE.putObject(this, nextOffset, this); 463 UNSAFE.putObject(this, itemOffset, this); 464 UNSAFE.putObject(this, waiterOffset, null); 509 // Unsafe mechanics 510 private static final sun.misc.Unsafe UNSAFE; [all...] |
SynchronousQueue.java | 216 UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); 229 UNSAFE.compareAndSwapObject(this, matchOffset, null, s)) { 244 UNSAFE.compareAndSwapObject(this, matchOffset, null, this); 251 // Unsafe mechanics 252 private static final sun.misc.Unsafe UNSAFE; 258 UNSAFE = sun.misc.Unsafe.getUnsafe(); 260 matchOffset = UNSAFE.objectFieldOffset 262 nextOffset = UNSAFE.objectFieldOffse [all...] |
ForkJoinPool.java | 656 UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc)) { 659 UNSAFE.unpark(w); 663 else if (UNSAFE.compareAndSwapLong 689 !UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc)) 693 UNSAFE.unpark(w); [all...] |
PriorityBlockingQueue.java | 251 UNSAFE.compareAndSwapInt(this, allocationSpinLockOffset, 906 // Unsafe mechanics 907 private static final sun.misc.Unsafe UNSAFE; 911 UNSAFE = sun.misc.Unsafe.getUnsafe(); 913 allocationSpinLockOffset = UNSAFE.objectFieldOffset
|
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 483 private static final sun.misc.Unsafe UNSAFE; 489 UNSAFE = sun.misc.Unsafe.getUnsafe(); 491 valueOffset = UNSAFE.objectFieldOffset 493 nextOffset = UNSAFE.objectFieldOffse [all...] |
/libcore/luni/src/main/java/java/util/concurrent/atomic/ |
AtomicMarkableReference.java | 162 // Unsafe mechanics 164 private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe(); 166 objectFieldOffset(UNSAFE, "pair", AtomicMarkableReference.class); 169 return UNSAFE.compareAndSwapObject(this, pairOffset, cmp, val); 172 static long objectFieldOffset(sun.misc.Unsafe UNSAFE, 175 return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
|
AtomicStampedReference.java | 163 // Unsafe mechanics 165 private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe(); 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 | 24 import sun.misc.Unsafe; 27 * Tests for the <code>park()</code> functionality of {@link Unsafe}. 30 private static Unsafe UNSAFE = null; 33 * Set up {@link #UNSAFE}. This subverts the access check to 34 * get the unique Unsafe instance. We can do this because 39 Field field = Unsafe.class.getDeclaredField("THE_ONE"); 42 UNSAFE = (Unsafe) field.get(null); 86 UNSAFE.unpark(parkerThread) [all...] |
/prebuilts/tools/common/guava-tools/ |
guava-13.0.1.jar | |