From d06387d4d35c145dc6370574bd869c98935c20fb Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Mon, 16 May 2022 16:28:36 -0700 Subject: [PATCH] Fixes for iosource::Manager for deadlocks during shutdown --- src/iosource/Manager.cc | 8 ++++---- src/iosource/Manager.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/iosource/Manager.cc b/src/iosource/Manager.cc index 439efda6c2..25a5994edd 100644 --- a/src/iosource/Manager.cc +++ b/src/iosource/Manager.cc @@ -43,10 +43,10 @@ void Manager::WakeupHandler::Process() flare.Extinguish(); } -void Manager::WakeupHandler::Ping(const std::string& where) +void Manager::WakeupHandler::Ping(std::string_view where) { - DBG_LOG(DBG_MAINLOOP, "Pinging WakeupHandler from %s", where.c_str()); - flare.Fire(); + DBG_LOG(DBG_MAINLOOP, "Pinging WakeupHandler from %s", where.data()); + flare.Fire(true); } Manager::Manager() @@ -98,7 +98,7 @@ void Manager::RemoveAll() dont_counts = sources.size(); } -void Manager::Wakeup(const std::string& where) +void Manager::Wakeup(std::string_view where) { if ( wakeup ) wakeup->Ping(where); diff --git a/src/iosource/Manager.h b/src/iosource/Manager.h index 1e2bbbface..ebbf85d561 100644 --- a/src/iosource/Manager.h +++ b/src/iosource/Manager.h @@ -144,7 +144,7 @@ public: * is called during RegisterFd and UnregisterFd since those methods cause * changes to the active set of file descriptors. */ - void Wakeup(const std::string& where); + void Wakeup(std::string_view where); private: /** @@ -186,7 +186,7 @@ private: * @param where a string denoting where this ping was called from. Used * for debugging output. */ - void Ping(const std::string& where); + void Ping(std::string_view where); // IOSource API methods void Process() override;