From 3bed7d5a5ee5870de4805dd2bf47e0523e387e76 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 23 Oct 2021 23:06:15 +0200 Subject: [PATCH] LibIPC: Use a zero-delay timer for message processing This lets us avoid using Core::deferred_invoke() which is not usable during application teardown (as there is no event loop to push the deferred invocation onto.) (Not that there is an event loop to fire the processing timer during teardown *either*, but at least we can exit gracefully with pending timers, unlike deferred invocations, which hang the process. This is an area where more improvements are definitely needed!) --- Userland/Libraries/LibIPC/Connection.cpp | 6 +++--- Userland/Libraries/LibIPC/Connection.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibIPC/Connection.cpp b/Userland/Libraries/LibIPC/Connection.cpp index 5780761d24..7aef9aeada 100644 --- a/Userland/Libraries/LibIPC/Connection.cpp +++ b/Userland/Libraries/LibIPC/Connection.cpp @@ -17,6 +17,7 @@ ConnectionBase::ConnectionBase(IPC::Stub& local_stub, NonnullRefPtris_active()) + m_processing_timer->start(); } return true; } diff --git a/Userland/Libraries/LibIPC/Connection.h b/Userland/Libraries/LibIPC/Connection.h index 446ba9e151..64b29b1569 100644 --- a/Userland/Libraries/LibIPC/Connection.h +++ b/Userland/Libraries/LibIPC/Connection.h @@ -60,6 +60,7 @@ protected: NonnullRefPtr m_socket; RefPtr m_responsiveness_timer; + RefPtr m_processing_timer; RefPtr m_notifier; NonnullOwnPtrVector m_unprocessed_messages;