From a8b42d24b71a94e13ae3e1a89e39fb3c1233d6b0 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 19 Apr 2017 16:06:20 +0300 Subject: [PATCH] Handle fake events when they are delivered Since fake events are delivered via the event loop they can and indeed should be processed immediately. --- server/core/dcb.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/core/dcb.cc b/server/core/dcb.cc index a57fbd86a..ea58b8eb6 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -2254,6 +2254,12 @@ static void dcb_hangup_foreach_worker(int thread_id, struct server* server) dcb->server == server) { poll_fake_hangup_event(dcb); + // dcb_hangup_foreach_worker() is called via the message loop, + // so immediately after the hangup event has been added, we can + // also process it. Indeed, it is necessary to do that because + // otherwise, unless there is a real event for the DCB descriptor, + // the fake event would not be handled. + dcb_process_fake_events(dcb, thread_id); } } }