public enum BusyPauser extends Enum<BusyPauser> implements Pauser
Pauser.SleepyWarning| Enum Constant and Description |
|---|
INSTANCE |
MIN_PROCESSORS, SLEEPY| Modifier and Type | Method and Description |
|---|---|
long |
countPaused()
Returns the number of times the pauser has checked for
completion.
|
void |
pause()
Pauses the current thread.
|
void |
reset()
Resets the pauser's internal state back to the most aggressive setting.
|
long |
timePaused()
Returns the paused time so far in milliseconds.
|
void |
unpause()
Try to cancel the pausing if it is pausing.
|
static BusyPauser |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BusyPauser[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BusyPauser INSTANCE
public static BusyPauser[] values()
for (BusyPauser c : BusyPauser.values()) System.out.println(c);
public static BusyPauser valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic void reset()
PauserCall this if you just did some work.
public void pause()
PauserDepending on the implementation this could do nothing (busy spin), yield, sleep, ...
Call this if no work was done.
public void unpause()
PauserNo guarantee is made as to if unpause will actually have an effect.
public long timePaused()
PausertimePaused in interface Pauserpublic long countPaused()
PausercountPaused in interface PauserCopyright © 2020. All rights reserved.