2 ==============================
4 int sem_wait(sem_t * sem);
5 int sem_trywait(sem_t * sem);
6 int sem_post(sem_t * sem);
7 int sem_getvalue(sem_t * sem, int * sval);
15 - current semaphore count, also used as a futex
18 - number of threads queued in sem_wait().
30 lll_unlock(sem->lock);
32 futex_wait(&sem->count, 0)
38 lll_unlock(sem->lock);
46 futex_wake(&sem->count, sem->count);
47 lll_unlock(sem->lock);
50 sem_trywait(sem_t *sem)
55 lll_unlock(sem->lock);
58 lll_unlock(sem->lock);
63 sem_getvalue(sem_t *sem, int *sval)