zeromq: Call super class DoTerminate() after stopping thread

The internal ZeroMQ thread would call QueueForProcessing() thereby
accessing the onloop member. As ThreadedBackend::DoTerminate() unsets it,
this was a) reported as a data race by TSAN and b) potentially caused
missed events that were still to be queued.
This commit is contained in:
Arne Welzel 2025-04-24 08:51:45 +02:00
parent 79c4fdb237
commit 63d31d7d9f

View file

@ -116,8 +116,6 @@ void ZeroMQBackend::DoInitPostScript() {
} }
void ZeroMQBackend::DoTerminate() { void ZeroMQBackend::DoTerminate() {
ThreadedBackend::DoTerminate();
// If self_thread is running, notify it to shutdown via the inproc // If self_thread is running, notify it to shutdown via the inproc
// socket, then wait for it to terminate. // socket, then wait for it to terminate.
if ( self_thread.joinable() && ! self_thread_shutdown_requested ) { if ( self_thread.joinable() && ! self_thread_shutdown_requested ) {
@ -152,6 +150,8 @@ void ZeroMQBackend::DoTerminate() {
proxy_thread.reset(); proxy_thread.reset();
} }
// ThreadedBackend::DoTerminate() cleans up the onloop instance.
ThreadedBackend::DoTerminate();
ZEROMQ_DEBUG("Terminated"); ZEROMQ_DEBUG("Terminated");
} }