POSIX semaphore: sem_open, sem_close, sem_post, sem_wait 2011-01-18 18:05 −一、Posix有名信号灯 1.posix有名信号灯函数 函数sem_open创建一个新的有名信号灯或打开一个已存在的有名信号灯。有名信号灯总是既可用于线程间的同步,又能用于进程间的同步。 1. sem_open 名称:: sem_open 功能: ...
int sem_post(sem_t *sem); 1. 2. Link with-pthread. Description sem_post() increments (unlocks) the semaphore pointed to bysem. If the semaphore’s value consequently becomes greater than zero, then another process or thread blocked in asem_wait(3)call will be woken up ...