- 論壇徽章:
- 0
|
請教給位老大:ULK2中描述信號量獲取的__down()函數時,回喚醒另一個等待進程,如果說喚醒另一個進程只是為了設置count和sleepers字段,那and terminates holding the semaphore這句話是什么意思?為什么要中止所持有的信號量?
原文如下: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. |
|