org.mentaqueue.wait
Class SpinParkWaitStrategy

java.lang.Object
  extended by org.mentaqueue.wait.SpinParkWaitStrategy
All Implemented Interfaces:
WaitStrategy

public class SpinParkWaitStrategy
extends Object
implements WaitStrategy

This wait strategy first busy-spins then parks with backing off if enabled.

Author:
Sergio Oliveira Jr.

Constructor Summary
SpinParkWaitStrategy()
           
SpinParkWaitStrategy(boolean parkBackOff)
           
SpinParkWaitStrategy(int spinCount)
           
SpinParkWaitStrategy(int spinCount, 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

SpinParkWaitStrategy

public SpinParkWaitStrategy(int spinCount,
                            boolean parkBackOff)

SpinParkWaitStrategy

public SpinParkWaitStrategy(boolean parkBackOff)

SpinParkWaitStrategy

public SpinParkWaitStrategy(int spinCount)

SpinParkWaitStrategy

public SpinParkWaitStrategy()
Method Detail

waitForOtherThread

public final void waitForOtherThread()
Description copied from interface: WaitStrategy
Do something to wait: busy spinning, yield or sleep.

Specified by:
waitForOtherThread in interface WaitStrategy

reset

public final void reset()
Description copied from interface: WaitStrategy
Reset the strategy because we have waited and we have accomplished what we were waiting for.

Specified by:
reset in interface WaitStrategy


Copyright © 2012. All Rights Reserved.