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

哲学家进餐问题那里少了个 think函数
This commit is contained in:
lqhao 2020-01-05 14:50:50 +08:00 committed by GitHub
parent 5f005e2263
commit 6a82412455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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. 读者-写者问题