/** * 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); }
public static void setInheritedAccessControlContext(Thread thread, AccessControlContext accessControlContext) { if (INHERITED_ACCESS_CONTROL_CONTEXT != null) INHERITED_ACCESS_CONTROL_CONTEXT.set(thread, accessControlContext); } }
public static void setTarget(Thread thread, Runnable target) { TARGET.set(thread, target); }
/** * Sets item to self and waiter to null, to avoid garbage * retention after matching or cancelling. Uses relaxed writes * because order is already constrained in the only calling * contexts: item is forgotten only after volatile/atomic * mechanics that extract items. Similarly, clearing waiter * follows either CAS or return from park (if ever parked; * else we don't care). */ final void forgetContents() { ITEM.set(this, this); // UNSAFE.putObject(this, itemOffset, this); SA.set(this, null); // UNSAFE.putObject(this, saOffset, null); WAITER.set(this, null); // UNSAFE.putObject(this, waiterOffset, null); }
public static void setThreadLocals(Thread thread, Object threadLocals) { THREAD_LOCALS.set(thread, threadLocals); }
Node(Object item, boolean isData) { ITEM.set(this, item); // UNSAFE.putObject(this, itemOffset, item); // relaxed write this.isData = isData; }
public static void setInheritableThreadLocals(Thread thread, Object inheritableThreadLocals) { INHERITABLE_THREAD_LOCALS.set(thread, inheritableThreadLocals); }
public static void setContextClassLoader(Thread thread, ClassLoader classLoader) { CONTEXT_CLASS_LOADER.set(thread, classLoader); }
/** * Constructs a new node. Uses relaxed write because item can * only be seen after publication via casNext. */ Node(SelectActionImpl sa) { ITEM.set(this, sa.message()); // UNSAFE.putObject(this, itemOffset, sa.message()); // relaxed write SA.set(this, sa); // UNSAFE.putObject(this, saOffset, sa); // relaxed write this.isData = sa.isData(); }