From 30cfb3e795de6e38a52f7c589c661c5cb07f3da2 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 14 May 2014 14:16:53 +0800 Subject: [PATCH] Correct a comment and clean up code that listens for universal notifier changes --- input_common.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/input_common.cpp b/input_common.cpp index 570930cbc..719659406 100644 --- a/input_common.cpp +++ b/input_common.cpp @@ -184,19 +184,16 @@ static wint_t readb() } } - /* Notifiers either poll or have an fd, not both. So at most one of these branches will be taken. */ - if (notifier.poll()) - { - env_universal_barrier(); - } - + /* Check to see if we want a barrier */ + bool barrier_from_poll = notifier.poll(); + bool barrier_from_readability = false; if (notifier_fd > 0 && FD_ISSET(notifier_fd, &fdset)) { - bool notified = notifier.notification_fd_became_readable(notifier_fd); - if (notified) - { - env_universal_barrier(); - } + barrier_from_readability = notifier.notification_fd_became_readable(notifier_fd); + } + if (barrier_from_poll || barrier_from_readability) + { + env_universal_barrier(); } if (ioport > 0 && FD_ISSET(ioport, &fdset))