public class LongPauser extends Object implements Pauser, TimingPauser
Pauser.SleepyWarningMIN_PROCESSORS, SLEEPY| Constructor and Description |
|---|
LongPauser(int minBusy,
int minCount,
long minTime,
long maxTime,
TimeUnit timeUnit)
first it will busy wait, then it will yield, then sleep for a small amount of time, then
increases to a large amount of time.
|
| Modifier and Type | Method and Description |
|---|---|
long |
countPaused() |
void |
pause() |
void |
pause(long timeout,
TimeUnit timeUnit)
Pauses but keep tracks of accumulated pause time and throws if timeout exceeded
|
void |
reset() |
long |
timePaused() |
void |
unpause() |
public LongPauser(int minBusy,
int minCount,
long minTime,
long maxTime,
@NotNull
TimeUnit timeUnit)
minBusy - the min number of times it will go around doing nothing, after this is
reached it will then start to yieldminCount - the number of times it will yield, before it starts to sleepminTime - the amount of time to sleep ( initially )maxTime - the amount of time subsequently to sleeptimeUnit - the unit of the minTime and maxTimepublic void pause(long timeout,
@NotNull
TimeUnit timeUnit)
throws TimeoutException
TimingPauserpause in interface Pauserpause in interface TimingPausertimeout - timeouttimeUnit - unitTimeoutException - thrown if timeout passespublic long timePaused()
timePaused in interface Pauserpublic long countPaused()
countPaused in interface PauserCopyright © 2019. All rights reserved.