musl/src/thread/sem_post.c

11 lines
158 B
C
Raw Normal View History

2011-03-04 00:45:59 -05:00
#include <semaphore.h>
#include "pthread_impl.h"
int sem_post(sem_t *sem)
{
a_inc(sem->__val);
if (sem->__val[1])
2011-03-04 00:45:59 -05:00
__wake(sem->__val, 1, 0);
return 0;
}