Update 计算机操作系统 - 进程管理.md
哲学家进餐问题那里少了个 think函数
This commit is contained in:
parent
5f005e2263
commit
6a82412455
@ -384,6 +384,13 @@ void check(i) {
|
|||||||
up(&s[i]);
|
up(&s[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void think(int i) {
|
||||||
|
down(&mutex);
|
||||||
|
state[i] = HUNGRY;
|
||||||
|
up(&mutex);
|
||||||
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2. 读者-写者问题
|
## 2. 读者-写者问题
|
||||||
|
Loading…
x
Reference in New Issue
Block a user