Allow up to n tasks to proceed simultaneously
A Semaphore is like a Condition , except that it does not broadcast
its events. Each event is supplied to callbacks only until one "accepts"
the event (by returning a true value).
Semaphore instances also have put() and take() methods that
respectively increase or decrease their value by 1.
Note that Semaphore does not automatically decrease its count due to
a callback or task resumption. You must explicitly take() the
semaphore in your task or callback to reduce its count.
Methods
|
|
put
take
|
|
put
|
put ( self )
See events.ICondition.put()
|
|
take
|
take ( self )
See events.ICondition.take()
|
|