- 论坛徽章:
- 0
|
最近在看《Operating Systems Design and Implementation ,Third Edition》
看到信号量这里(2.26),书里面有一段话,我觉得似乎说错了。注意加粗段。
A mutex is a variable that can be in one of two states: unlocked or locked. Consequently, only 1 bit is required to represent it, but in practice an integer often is used, with 0 meaning unlocked and all other values meaning locked. Two procedures are used with mutexes. When a process (or thread) needs access to a critical region, it calls mutex_lock. If the mutex is currently unlocked (meaning that the critical region is available), the call succeeds and the calling thread is free to enter the critical region.
应该是1意味着unlocked,0是locked
是我理解错了,还是作者说错了? |
|