mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Notifier: Fix condition variable race.
This commit is contained in:
@@ -36,8 +36,10 @@ void Notifier::Stop() {
|
||||
void Notifier::ThreadMain() {
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
while (m_active) {
|
||||
m_cond.wait(lock);
|
||||
if (!m_active) continue;
|
||||
while (m_entry_notifications.empty() && m_conn_notifications.empty()) {
|
||||
m_cond.wait(lock);
|
||||
if (!m_active) return;
|
||||
}
|
||||
|
||||
// Entry notifications
|
||||
while (!m_entry_notifications.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user