Attempt to lock the semaphore without blocking. Immediately return False if it is not available.
Attempt to lock the semaphore without blocking, and call error if the semaphore is unavailable.
This function should only be called when you want to lock the semaphore, and can guarantee that doing so will not block.
Wait on a semaphore with a timeout value. Returns True if a lock was acquired, False if it timed out before acquiring a lock.
if interrupted by a signal, semTimedWait will retry. An exception will be raised if sem_timedwait() fails for any other reason.