Package com.diozero.util
Class EventLock
- java.lang.Object
-
- com.diozero.util.EventLock
-
public class EventLock extends Object
-
-
Constructor Summary
Constructors Constructor Description EventLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
doWait()
Wait indefinitely for set() to be called.boolean
doWait(int timeout)
Wait the specified time period for set() to be called.void
set()
-
-
-
Method Detail
-
doWait
public boolean doWait() throws InterruptedException
Wait indefinitely for set() to be called.- Returns:
- True if set() was called, false woken unexpectedly.
- Throws:
InterruptedException
- If interrupted.
-
doWait
public boolean doWait(int timeout) throws InterruptedException
Wait the specified time period for set() to be called.- Parameters:
timeout
- Timeout value in milliseconds.- Returns:
- True if set() was called, false if timed out waiting.
- Throws:
InterruptedException
- If interrupted.
-
set
public void set()
-
clear
public void clear()
-
-