unsigned ctl_semaphore_wait(CTL_SEMAPHORE_t *s, CTL_TIMEOUT_t t, CTL_TIME_t timeout);
ctl_semaphore_wait waits for the semaphore pointed to by s to be non-zero. If the semaphore is zero then the caller will block unless timeoutType is non-zero and the current time reaches the timeout value. If the timeout occurred ctl_semaphore_wait returns zero otherwise it returns one.
ctl_semaphore_wait must not be called from an interrupt service routine.