Update 计算机操作系统 - 进程管理.md

进程管理-哲学家进餐问题列出的代码 少了一个think函数
This commit is contained in:
lqhao 2020-01-05 14:59:33 +08:00 committed by GitHub
parent 5f005e2263
commit baa5d04837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -384,6 +384,11 @@ void check(i) {
up(&s[i]);
}
}
void think(int i) {
down(&mutex);
state[i] = HUNGRY;
up(&mutex);
}
```
## 2. 读者-写者问题