|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mentaqueue.wait.YieldParkWaitStrategy
public class YieldParkWaitStrategy
No busy spinning, just yield and sleep. You can configure how many iteration to yield before sleeping. Supporing backing-off functionality, in other words, if turned on, the sleeping time will increase by one nanosecond gradually until reset is called.
| Constructor Summary | |
|---|---|
YieldParkWaitStrategy()
|
|
YieldParkWaitStrategy(boolean parkBackOff)
|
|
YieldParkWaitStrategy(int yieldCount)
|
|
YieldParkWaitStrategy(int yieldCount,
boolean parkBackOff)
|
|
| Method Summary | |
|---|---|
void |
reset()
Reset the strategy because we have waited and we have accomplished what we were waiting for. |
void |
waitForOtherThread()
Do something to wait: busy spinning, yield or sleep. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public YieldParkWaitStrategy(int yieldCount,
boolean parkBackOff)
public YieldParkWaitStrategy(int yieldCount)
public YieldParkWaitStrategy(boolean parkBackOff)
public YieldParkWaitStrategy()
| Method Detail |
|---|
public final void waitForOtherThread()
WaitStrategy
waitForOtherThread in interface WaitStrategypublic final void reset()
WaitStrategy
reset in interface WaitStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||