diff --git a/book/zh-cn/07-thread.md b/book/zh-cn/07-thread.md index 771d1f2..893acd2 100644 --- a/book/zh-cn/07-thread.md +++ b/book/zh-cn/07-thread.md @@ -153,6 +153,7 @@ int main() cond_var.notify_one(); } done = true; + notified = true; cond_var.notify_one(); }); diff --git a/code/7/7.2.cpp b/code/7/7.2.cpp index 7fd9d87..6f6e5a9 100644 --- a/code/7/7.2.cpp +++ b/code/7/7.2.cpp @@ -39,6 +39,7 @@ int main() cond_var.notify_one(); } done = true; + notified = true; cond_var.notify_one(); }); // 消费者线程