public class EventSemaphore extends Object
This is specifically to handle the situation where the event may have been posted before the wait method is called. This behaviour is not supported by the existing wait and notify methods.
Modifier and Type | Method and Description |
---|---|
boolean |
isPosted() |
void |
waitEvent()
Waits for the event to be posted.
|
void |
waitTimeoutEvent(int cmtTimeout) |
public boolean isPosted()
public void waitEvent() throws InterruptedException
If the event has already been posted, then the operation returns immediately.
InterruptedException
- The wait was interrupted.public void waitTimeoutEvent(int cmtTimeout) throws InterruptedException
InterruptedException
Copyright © 2019. All rights reserved.