- 論壇徽章:
- 0
|
請(qǐng)教給位老大:ULK2中描述信號(hào)量獲取的__down()函數(shù)時(shí),回喚醒另一個(gè)等待進(jìn)程,如果說喚醒另一個(gè)進(jìn)程只是為了設(shè)置count和sleepers字段,那and terminates holding the semaphore這句話是什么意思?為什么要中止所持有的信號(hào)量?
原文如下:If the count field is not negative, the function sets sleepers to 0 and exits from the loop. It tries to wake up another process in the semaphore wait queue (but in our scenario, the queue is now empty) and terminates holding the semaphore. On exit, both the count field and the sleepers field are set to 0, as required when the semaphore is closed but no process is waiting for it. |
|