After using the Shared resource, the semaphore count can be set to 1 by using semop .
在使用完共享资源之后,可以使用semop将信号量计数设置为1。
To wait on an event, semop() function is used with sem_op value as -1 thus blocking the calling process until it is signaled.
要等待某个事件,则可以使用 semop()函数,并将 sem_op 的值设置为-1,这样就可以阻塞调用进程,直到它变为有信号状态为止。
The function semop performs a set of operations contained in sops atomically (all operations performed at the same time only if they can be performed at the same time).
函数semop原子地执行sops中包含的一组操作(只在所有操作都可以同时成功执行时,才会将所有的操作同时一次执行完)。
The function semop performs a set of operations contained in sops atomically (all operations performed at the same time only if they can be performed at the same time).
函数semop原子地执行sops中包含的一组操作(只在所有操作都可以同时成功执行时,才会将所有的操作同时一次执行完)。
应用推荐