@Deprecated public class LightPauser extends Object implements Pauser
Pauser.SleepyWarning| Modifier and Type | Field and Description |
|---|---|
static long |
NO_BUSY_PERIOD
Deprecated.
|
BALANCED, MIN_PROCESSORS, SLEEPY| Constructor and Description |
|---|
LightPauser(long busyPeriodNS,
long parkPeriodNS)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
asyncPause()
Deprecated.
Pauses "asynchronously" whereby the issuing EventHandler can
pause without blocking other handlers in the EventLoop.
|
boolean |
asyncPausing()
Deprecated.
Returns if this Pauser is still asynchronously pausing.
|
long |
countPaused()
Deprecated.
Returns the number of times the pauser has checked for
completion.
|
protected void |
doPause(long maxPauseNS)
Deprecated.
|
void |
pause()
Deprecated.
Pauses the current thread.
|
void |
reset()
Deprecated.
Resets the pauser's internal state back (if any) to the most aggressive setting.
|
long |
timePaused()
Deprecated.
Returns the paused time so far in milliseconds.
|
void |
unpause()
Deprecated.
Try to cancel the pausing if it is pausing.
|
public static final long NO_BUSY_PERIOD
public void reset()
PauserPausers that progressively increases the pause time are reset back to its lowest pause time.
Call this if you just did some work.
public void pause()
PauserThe actual pause time and thread scheduling impact is not specified and depends on the implementing class. For some implementations, a progressive increase of the pause time is employed, thread executions may or may not be yielded, whereas other implementations may not pause or yield at all.
Thus, depending on the implementation this could do nothing (busy spin), yield, sleep, ...
Call this if no work was done.
public void asyncPause()
Pauser
The issuing EventHandler can check if it is still pausing
asynchronously by invoking Pauser.asyncPausing(). Typically this is
done as depicted below:
{@codeasyncPause in interface PauserPauser.asyncPausing()public boolean asyncPausing()
PauserasyncPausing in interface Pauserprotected void doPause(long maxPauseNS)
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 © 2021. All rights reserved.