aboutsummaryrefslogtreecommitdiffstats
path: root/src/event/SocketMonitor.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-07 23:57:30 +0200
committerMax Kellermann <max@duempel.org>2013-08-08 00:18:59 +0200
commitb63db1c1aa220cf9866f6b8b01b62f16e15c58a1 (patch)
treee64ea6157f59b17a67f9b0c9bcbce34729eb6f31 /src/event/SocketMonitor.cxx
parent0287ac794e5117772953394fcbc93912cf8e3c22 (diff)
downloadmpd-b63db1c1aa220cf9866f6b8b01b62f16e15c58a1.tar.gz
mpd-b63db1c1aa220cf9866f6b8b01b62f16e15c58a1.tar.xz
mpd-b63db1c1aa220cf9866f6b8b01b62f16e15c58a1.zip
event/SocketMonitor: un-inline Schedule()
Merge with CommitEventFlags().
Diffstat (limited to '')
-rw-r--r--src/event/SocketMonitor.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/event/SocketMonitor.cxx b/src/event/SocketMonitor.cxx
index 9bb6e47cf..0b929dd72 100644
--- a/src/event/SocketMonitor.cxx
+++ b/src/event/SocketMonitor.cxx
@@ -135,6 +135,20 @@ SocketMonitor::Close()
close_socket(Steal());
}
+void
+SocketMonitor::Schedule(unsigned flags)
+{
+ assert(IsDefined());
+
+ if (flags == GetScheduledFlags())
+ return;
+
+ poll.events = flags;
+ poll.revents &= flags;
+
+ loop.WakeUp();
+}
+
SocketMonitor::ssize_t
SocketMonitor::Read(void *data, size_t length)
{
@@ -163,11 +177,3 @@ SocketMonitor::Write(const void *data, size_t length)
return send(Get(), (const char *)data, length, flags);
}
-
-void
-SocketMonitor::CommitEventFlags()
-{
- assert(IsDefined());
-
- loop.WakeUp();
-}