Constructor
Methods
acquire():Void
Locks the semaphore. If the value of the semaphore is zero, then the thread will block until it is able to lock the semaphore. If the value is non-zero, it is decreased by one.
tryAcquire(?timeout:Float):Bool
Try to lock the semaphore.
If the value of the semaphore is zero, false
is returned, else the value is increased.
If timeout
is specified, this function will block until the thread is able to acquire the semaphore, or the timeout expires.
timeout
is in seconds.