diff options
-rw-r--r-- | Userland/Libraries/LibIPC/Connection.cpp | 6 | ||||
-rw-r--r-- | 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, NonnullRefPtr<Core::LocalS , m_local_endpoint_magic(local_endpoint_magic) { m_responsiveness_timer = Core::Timer::create_single_shot(3000, [this] { may_have_become_unresponsive(); }); + m_processing_timer = Core::Timer::create_single_shot(0, [this] { handle_messages(); }); } ConnectionBase::~ConnectionBase() @@ -175,9 +176,8 @@ bool ConnectionBase::drain_messages_from_peer() } if (!m_unprocessed_messages.is_empty()) { - deferred_invoke([this] { - handle_messages(); - }); + if (!m_processing_timer->is_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<Core::LocalSocket> m_socket; RefPtr<Core::Timer> m_responsiveness_timer; + RefPtr<Core::Timer> m_processing_timer; RefPtr<Core::Notifier> m_notifier; NonnullOwnPtrVector<Message> m_unprocessed_messages; |