A semaphore can be owned by setting the initial count of the semaphore to 0 using semctl .
可以通过使用semctl将信号量计数器的初始值设置为0来获得信号量。
youdao
In order to initialize the semaphore-set data structure, use the semctl system call with the IPC_SET command.
为了对信号量集数据结构进行初始化,可以使用IPC_SET命令来调用semctl系统调用。
系统调用semctl用来执行在信号量集上的控制操作。这和在消息队列中的系统调用msgctl是十分相似的。但这两个系统调用的参数略有不同。
详细内容
应用推荐
模块上移
模块下移
不移动