implement POSIX semaphores
This commit is contained in:
parent
03dcc3417c
commit
6fc5fdbdc7
10 changed files with 201 additions and 0 deletions
8
src/thread/sem_getvalue.c
Normal file
8
src/thread/sem_getvalue.c
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include <semaphore.h>
|
||||
|
||||
int sem_getvalue(sem_t *sem, int *valp)
|
||||
{
|
||||
int val = sem->__val[0];
|
||||
*valp = val < 0 ? 0 : val;
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue