Clean up some "dubious" conv var signalling.

This commit is contained in:
Rene Rivera
2023-09-01 21:24:20 -05:00
parent 3566040eac
commit 7dad413326
+6 -1
View File
@@ -62,6 +62,7 @@ inline bool sync::signal()
// Wait for wait() to get called.
if (!wait_arrived.load()) return false;
// Tell the waiter that we arrived.
std::unique_lock<std::mutex> lock(arrived_mx);
signal_arrived = true;
arrived_cv.notify_one();
#endif
@@ -243,6 +244,7 @@ inline void executor::implementation::push_group(std::shared_ptr<group> g)
inline void executor::implementation::call_signal()
{
scope_lock_t lock(mx);
#if B2_USE_STD_THREADS
call_cv.notify_one();
#endif
@@ -296,7 +298,10 @@ inline void executor::implementation::stop()
}
for (auto & t : to_join)
{
call_cv.notify_all();
{
scope_lock_t lock(mx);
call_cv.notify_all();
}
t.join();
}
#endif