Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private static long |
MINIMAL_DELTA_FOR_LOGGING |
private int |
period |
private Object |
sleepLock |
private Stoppable |
stopper |
private boolean |
triggerWake |
Modifier and Type | Method and Description |
---|---|
int |
getPeriod() |
void |
skipSleepCycle()
If currently asleep, stops sleeping; if not asleep, will skip the next
sleep cycle.
|
void |
sleep()
Sleep for period.
|
void |
sleep(long sleepTime) |
private static final org.slf4j.Logger LOG
private final int period
private static final long MINIMAL_DELTA_FOR_LOGGING
private boolean triggerWake
public Sleeper(int sleep, Stoppable stopper)
sleep
- sleep time in millisecondsstopper
- When Stoppable.isStopped()
is true, this thread will
cleanup and exit cleanly.public void skipSleepCycle()
public void sleep()
public void sleep(long sleepTime)
public final int getPeriod()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.