Package co.paralleluniverse.fibers
Class SchedulerLocal<T>
- java.lang.Object
-
- co.paralleluniverse.fibers.SchedulerLocal<T>
-
public class SchedulerLocal<T> extends java.lang.ObjectAssociates a value with the currentFiberScheduler
-
-
Constructor Summary
Constructors Constructor Description SchedulerLocal()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()Returns the scheduler-local value of thisSchedulerLocal.protected TinitialValue(FiberScheduler scheduler)Computes the initial value for the currentFiberScheduler.voidremove()Removes the association between the scheduler-local value and the current scheduler.voidset(T value)Sets the scheduler-local value of thisSchedulerLocal.
-
-
-
Method Detail
-
initialValue
protected T initialValue(FiberScheduler scheduler)
Computes the initial value for the currentFiberScheduler. Returnsnullby default;- Parameters:
scheduler- the currentFiberScheduler- Returns:
- the initial value
-
get
public final T get() throws SuspendExecution
Returns the scheduler-local value of thisSchedulerLocal.- Throws:
SuspendExecution
-
set
public final void set(T value)
Sets the scheduler-local value of thisSchedulerLocal.
-
remove
public final void remove()
Removes the association between the scheduler-local value and the current scheduler. The next call toget()would return the initial value returned by a fresh call toinitialValue.
-
-