mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ntcore] Release ListenerStorage mutex before stopping thread (#8562)
If the thread is still running then it will deadlock. Fixes #8561
This commit is contained in:
@@ -346,14 +346,16 @@ bool ListenerStorage::WaitForListenerQueue(double timeout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ListenerStorage::Reset() {
|
void ListenerStorage::Reset() {
|
||||||
std::scoped_lock lock{m_mutex};
|
{
|
||||||
m_pollers.clear();
|
std::scoped_lock lock{m_mutex};
|
||||||
m_listeners.clear();
|
m_pollers.clear();
|
||||||
m_connListeners.clear();
|
m_listeners.clear();
|
||||||
m_topicListeners.clear();
|
m_connListeners.clear();
|
||||||
m_valueListeners.clear();
|
m_topicListeners.clear();
|
||||||
m_logListeners.clear();
|
m_valueListeners.clear();
|
||||||
m_timeSyncListeners.clear();
|
m_logListeners.clear();
|
||||||
|
m_timeSyncListeners.clear();
|
||||||
|
}
|
||||||
m_thread.Join();
|
m_thread.Join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user