Value (semaphore count) is the initial value of the semaphore.
value(信号量计数器)是这个信号量的初始值。
This function suspends the calling thread until the semaphore has a non-zero count.
这个函数会挂起调用线程,直到这个信号量有一个非空计数为止。
Then it atomically decreases the semaphore count.
然后它自动地减少信号的计数值。
After using the Shared resource, the semaphore count can be set to 1 by using semop .
在使用完共享资源之后,可以使用semop将信号量计数设置为1。
A semaphore can be owned by setting the initial count of the semaphore to 0 using semctl .
可以通过使用semctl将信号量计数器的初始值设置为0来获得信号量。
Linux POSIX semaphores use sem_wait to suspend the calling thread until the semaphore has a non-zero count.
LinuxPOSIX信号使用sem_wait来挂起发出调用的线程,直到信号拥有了非零的计数值。
Linux USES the pthread_condition_init call to create a semaphore object within the current process that maintains a count between zero and a maximum value.
Linux使用pthread_condition_init调用在当前进程内创建信号对象,在其中维持一个在零与最大值之间的计数值。
LpPreviousCount is the pointer to the variable where the previous semaphore count is returned.
lpPreviousCount是指向上一个信号量计数器返回时的变量的指针。
When the count reaches zero, the state of the semaphore object becomes non-signaled.
当计数值成为零时,信号对象的状态成为non - signaled。
This call also initializes the semaphore count: int sem_init(sem_t *sem, int pshared, unsigned int value). In this code
它还会对信号量计数器进行初始化:intsem_init(sem_t *sem, intpshared,unsigned intvalue)。
LMaximumCount is the maximum count of the semaphore and must be greater than zero.
lMaximumCount是该信号量的最大值,该值必须大于0。
Exits the semaphore a specified number of times and returns the previous count.
以指定的次数退出信号量并返回前一个计数。
Exits the semaphore a specified number of times and returns the previous count.
以指定的次数退出信号量并返回前一个计数。
应用推荐