mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 04:34:40 +03:00
fix: potential endless loop (#22)
* fix potential endless loop * update code as well
This commit is contained in:
@@ -153,6 +153,7 @@ int main()
|
||||
cond_var.notify_one();
|
||||
}
|
||||
done = true;
|
||||
notified = true;
|
||||
cond_var.notify_one();
|
||||
});
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ int main()
|
||||
cond_var.notify_one();
|
||||
}
|
||||
done = true;
|
||||
notified = true;
|
||||
cond_var.notify_one();
|
||||
});
|
||||
// 消费者线程
|
||||
|
||||
Reference in New Issue
Block a user