然而,如果调用线程已经存在一个事务,则将此事务挂起,并创建和使用一个新事务。
However, if there is already a transaction on the calling thread, that transaction is suspended, and a new transaction is created and used.
这个函数会挂起调用线程,直到这个信号量有一个非空计数为止。
This function suspends the calling thread until the semaphore has a non-zero count.
当拥有锁的线程离开临界区的时候,挂起的线程需要被重新唤醒,然后重新被调用,并交换上下文,回到CPU调度中。
When the thread that has the lock leaves the critical section, the suspended thread needs to be woken up. The thread will need to be re-scheduling and context switched back into the CPU.
应用推荐