Blocks until the specified number of state change notifications have been received since last call to reset().
Does not block at all if at least count state change notifications have been received since the last call to reset . Otherwise only blocks until the missing number of notifications has arrived. Before returning, this method subtracts count from the internal counter for state change notifications, which allows a client to catch up with fast firing event notifications by calling this method several times.
Note that the "synchronized" modifier is required in order for the client thread to obtain ownership of this semaphore (i.e. its monitor), without which the thread synchronization would not work. See Object#notify() for an explanation.
- Parameters:
-
| count | number of state change notifications that must be received since last call to reset() so that this call will return |
- Exceptions:
-
|