uv.luv_sem_t
Methods3
function luv_sem_t.post()
Increments (unlocks) a semaphore, if the semaphore's value consequently becomes greater than zero then another thread blocked in a sem_wait call will be woken and proceed to decrement the semaphore.
function luv_sem_t.wait()
Decrements (locks) a semaphore, if the semaphore's value is greater than zero then the value is decremented and the call returns immediately. If the semaphore's value is zero then the call blocks until the semaphore's value rises above zero or the call is interrupted by a signal.
function luv_sem_t.trywait() -> boolean
The same as uv.sem_wait() but returns immediately if the semaphore is not available.
If the semaphore's value was decremented then true is returned, otherwise the semaphore has a value of zero and false is returned.