WrappedThread
com.jsmacrosce.jsmacros.graal.language.impl.WrappedThread
Associates a Java thread with its Graal task-queue priority and a one-way readiness signal.
js
const WrappedThread = Java.type("com.jsmacrosce.jsmacros.graal.language.impl.WrappedThread");
const Thread = Java.type("java.lang.Thread");
const task = new WrappedThread(Thread.currentThread(), 5);
task.notifyReady();
task.waitUntilReady(); // already signaled: returns without parkingDo not block a script waiting for a notifier that has not been scheduled.
Constructors
new WrappedThread
Fields
priority
Graal task-queue priority value, not a
Thread.setPriority value.thread
Methods
notifyReady
notifyReady(): void#Sets readiness and unparks the represented thread; readiness is one-way.
waitUntilReady
waitUntilReady(): void#Waits for readiness on the represented thread; another caller receives an
AssertionError. Parks while not ready. After each park, an interrupt clears the current thread's interrupt status and causes InterruptedException; an already-ready call returns without checking it.