non-blocking check on a semaphore.
-
Parameters:
-
sem - a valid semaphore
a non-blocking variant of sem_wait. If the semaphore has non-zero count, the count is atomically decreased and sem_trywait immediately returns 0. If the semaphore count is zero, sem_trywait immediately returns with error EAGAIN.
this is IRQ handler safe.
increase semaphore count.
-
Parameters:
-
sem - a valid semaphore
atomically increases the count of the semaphore. This function never blocks and can safely be used in asynchronous signal handlers.