diff options
author | Max Kellermann <max@duempel.org> | 2014-01-04 19:31:23 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-04 19:31:23 +0100 |
commit | f0d3b47ad819eadf04569d6886b7aa7d06154511 (patch) | |
tree | 6276888d083341499782c80d4aeab84016c1f91d /src/event/TimeoutMonitor.cxx | |
parent | bfe75335465711faae3181c5224119b23cc9d2e0 (diff) | |
download | mpd-f0d3b47ad819eadf04569d6886b7aa7d06154511.tar.gz mpd-f0d3b47ad819eadf04569d6886b7aa7d06154511.tar.xz mpd-f0d3b47ad819eadf04569d6886b7aa7d06154511.zip |
event/Loop: remove the GLib implementation
Now that the remaining known bugs in poll() implementation are fixed,
we can go on without the GLib implementation.
Diffstat (limited to '')
-rw-r--r-- | src/event/TimeoutMonitor.cxx | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/src/event/TimeoutMonitor.cxx b/src/event/TimeoutMonitor.cxx index 3d7d46324..55260af2a 100644 --- a/src/event/TimeoutMonitor.cxx +++ b/src/event/TimeoutMonitor.cxx @@ -25,32 +25,19 @@ void TimeoutMonitor::Cancel() { if (IsActive()) { -#ifdef USE_INTERNAL_EVENTLOOP active = false; loop.CancelTimer(*this); -#endif - -#ifdef USE_GLIB_EVENTLOOP - g_source_destroy(source); - g_source_unref(source); - source = nullptr; -#endif } } void + TimeoutMonitor::Schedule(unsigned ms) { Cancel(); -#ifdef USE_INTERNAL_EVENTLOOP active = true; loop.AddTimer(*this, ms); -#endif - -#ifdef USE_GLIB_EVENTLOOP - source = loop.AddTimeout(ms, Callback, this); -#endif } void @@ -58,33 +45,11 @@ TimeoutMonitor::ScheduleSeconds(unsigned s) { Cancel(); -#ifdef USE_INTERNAL_EVENTLOOP Schedule(s * 1000u); -#endif - -#ifdef USE_GLIB_EVENTLOOP - source = loop.AddTimeoutSeconds(s, Callback, this); -#endif } void TimeoutMonitor::Run() { -#ifdef USE_GLIB_EVENTLOOP - Cancel(); -#endif - OnTimeout(); } - -#ifdef USE_GLIB_EVENTLOOP - -gboolean -TimeoutMonitor::Callback(gpointer data) -{ - TimeoutMonitor &monitor = *(TimeoutMonitor *)data; - monitor.Run(); - return false; -} - -#endif |