多线程编程指南

sem_wait 语法

int	sem_wait(sem_t *sem);
#include <semaphore.h>



sem_t sem;

int ret;



ret = sem_wait(&sem); /* wait for semaphore */