aboutsummaryrefslogtreecommitdiffhomepage
path: root/input_common.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-05-14 14:16:53 +0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-05-14 14:16:53 +0800
commit30cfb3e795de6e38a52f7c589c661c5cb07f3da2 (patch)
tree6500e19533fe6c170d6ff3fc4c4a5ded42a04f36 /input_common.cpp
parenta0e6d4375a915d972808a41b35bea1f5e5089db6 (diff)
Correct a comment and clean up code that listens for universal notifier
changes
Diffstat (limited to 'input_common.cpp')
-rw-r--r--input_common.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/input_common.cpp b/input_common.cpp
index 570930cb..71965940 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())
+ /* 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))
{
- env_universal_barrier();
+ barrier_from_readability = notifier.notification_fd_became_readable(notifier_fd);
}
-
- if (notifier_fd > 0 && FD_ISSET(notifier_fd, &fdset))
+ if (barrier_from_poll || barrier_from_readability)
{
- bool notified = notifier.notification_fd_became_readable(notifier_fd);
- if (notified)
- {
- env_universal_barrier();
- }
+ env_universal_barrier();
}
if (ioport > 0 && FD_ISSET(ioport, &fdset))