public static AccessControlContext getInheritedAccessControlContext(Thread thread) { if (INHERITED_ACCESS_CONTROL_CONTEXT == null) return null; return (AccessControlContext) INHERITED_ACCESS_CONTROL_CONTEXT.get(thread); }
/** * CAS tail field. Used only by enq. */ private final boolean compareAndSetTail(Node expect, Node update) { return TAIL.compareAndSet(this, expect, update); }
void decrement() { SUBSCRIBERS.getAndAdd(this, -1); }
@Override void clearValue(Node node) { VALUE.setOpaque(node, null); // UNSAFE.putOrderedObject(node, valueOffset, null); }
/** * Links node to itself to avoid garbage retention. Called * only after CASing head field, so uses relaxed write. */ final void forgetNext() { NEXT.set(this, this); // UNSAFE.putObject(this, nextOffset, this); }
WNode h; for (;;) { s = (long)STATE.getVolatile(this); // see above if ((s & SBITS) != (stamp & SBITS)) break; break; else if (m < RFULL) { if (STATE.compareAndSet(this, s, next = s - RUNIT)) { if (m == RUNIT && (h = whead) != null && h.status != 0) release(h);
private static Object get(Node n, int i) { return ARRAY.getVolatile(((ObjectNode) n).array, i); }
private void set(int i, E value) { ARRAY.setVolatile(array, i, value); }
/** * Apply the chain of transforms and bind them to an array varhandle operation. The * signature at the endpoint must match the VarHandle access type passed in. */ public MethodHandle arrayAccess(VarHandle.AccessMode mode) { return invoke(MethodHandles.arrayElementVarHandle(type().parameterType(0)).toMethodHandle(mode)); }
private void orderedSetHead(long value) { HEAD.setOpaque(this, value); // UNSAFE.putOrderedLong(this, headOffset, value); } }
public static void setInheritedAccessControlContext(Thread thread, AccessControlContext accessControlContext) { if (INHERITED_ACCESS_CONTROL_CONTEXT != null) INHERITED_ACCESS_CONTROL_CONTEXT.set(thread, accessControlContext); } }
private E get(int i) { return (E) ARRAY.getVolatile(array, i); }
private void volatileSet(int i, Object value) { ARRAY.setVolatile(array, i, value); }
/** * Exclusively acquires the lock if it is immediately available. * * @return a stamp that can be used to unlock or convert mode, * or zero if the lock is not available */ public long tryWriteLock() { long s, next; return ((((s = state) & ABITS) == 0L && STATE.compareAndSet(this, s, next = s + WBIT)) ? next : 0L); }
void orderedSetHead(Node value) { HEAD.setOpaque(this, value); // UNSAFE.putOrderedObject(this, headOffset, value); }
public static Object getThreadLocals(Thread thread) { return (Object) THREAD_LOCALS.get(thread); }
public static void setTarget(Thread thread, Runnable target) { TARGET.set(thread, target); }
private Object get(int i) { return ARRAY.getVolatile(array, i); }
@Override protected void subscribeActual(org.reactivestreams.Subscriber<? super T> s) { SUBSCRIBERS.getAndAdd(this, 1); actual.subscribe(new FlowSubscriber(s)); }
/** * CAS maxReadIndex field. Used only by postEnq. */ private boolean compareAndSetMaxReadIndex(long expect, long update) { return MAX_READ_INDEX.compareAndSet(this, expect, update); } }