aboutsummaryrefslogtreecommitdiffstats
path: root/src/event/DeferredMonitor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/event/DeferredMonitor.cxx')
-rw-r--r--src/event/DeferredMonitor.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/event/DeferredMonitor.cxx b/src/event/DeferredMonitor.cxx
index 4ffffaa89..40b4b0b62 100644
--- a/src/event/DeferredMonitor.cxx
+++ b/src/event/DeferredMonitor.cxx
@@ -24,9 +24,10 @@
void
DeferredMonitor::Cancel()
{
-#ifdef USE_EPOLL
+#ifdef USE_INTERNAL_EVENTLOOP
pending = false;
-#else
+#endif
+#ifdef USE_GLIB_EVENTLOOP
const auto id = source_id.exchange(0);
if (id != 0)
g_source_remove(id);
@@ -36,10 +37,11 @@ DeferredMonitor::Cancel()
void
DeferredMonitor::Schedule()
{
-#ifdef USE_EPOLL
+#ifdef USE_INTERNAL_EVENTLOOP
if (!pending.exchange(true))
fd.Write();
-#else
+#endif
+#ifdef USE_GLIB_EVENTLOOP
const unsigned id = loop.AddIdle(Callback, this);
const auto old_id = source_id.exchange(id);
if (old_id != 0)
@@ -47,7 +49,7 @@ DeferredMonitor::Schedule()
#endif
}
-#ifdef USE_EPOLL
+#ifdef USE_INTERNAL_EVENTLOOP
bool
DeferredMonitor::OnSocketReady(unsigned)
@@ -60,7 +62,9 @@ DeferredMonitor::OnSocketReady(unsigned)
return true;
}
-#else
+#endif
+
+#ifdef USE_GLIB_EVENTLOOP
void
DeferredMonitor::Run()