aboutsummaryrefslogtreecommitdiffstats
path: root/src/event/Loop.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-04 19:31:23 +0100
committerMax Kellermann <max@duempel.org>2014-01-04 19:31:23 +0100
commitf0d3b47ad819eadf04569d6886b7aa7d06154511 (patch)
tree6276888d083341499782c80d4aeab84016c1f91d /src/event/Loop.hxx
parentbfe75335465711faae3181c5224119b23cc9d2e0 (diff)
downloadmpd-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 'src/event/Loop.hxx')
-rw-r--r--src/event/Loop.hxx62
1 files changed, 1 insertions, 61 deletions
diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx
index 60d52ba52..5ac7d635f 100644
--- a/src/event/Loop.hxx
+++ b/src/event/Loop.hxx
@@ -24,7 +24,6 @@
#include "thread/Id.hxx"
#include "Compiler.h"
-#ifdef USE_INTERNAL_EVENTLOOP
#include "PollGroup.hxx"
#include "thread/Mutex.hxx"
#include "WakeFD.hxx"
@@ -32,18 +31,11 @@
#include <list>
#include <set>
-#endif
-#ifdef USE_GLIB_EVENTLOOP
-#include <glib.h>
-#endif
-
-#ifdef USE_INTERNAL_EVENTLOOP
class TimeoutMonitor;
class IdleMonitor;
class DeferredMonitor;
class SocketMonitor;
-#endif
#include <assert.h>
@@ -56,12 +48,8 @@ class SocketMonitor;
*
* @see SocketMonitor, MultiSocketMonitor, TimeoutMonitor, IdleMonitor
*/
-class EventLoop final
-#ifdef USE_INTERNAL_EVENTLOOP
- : private SocketMonitor
-#endif
+class EventLoop final : SocketMonitor
{
-#ifdef USE_INTERNAL_EVENTLOOP
struct TimerRecord {
/**
* Projected monotonic_clock_ms() value when this
@@ -98,12 +86,6 @@ class EventLoop final
PollGroup poll_group;
PollResult poll_result;
-#endif
-
-#ifdef USE_GLIB_EVENTLOOP
- GMainContext *context;
- GMainLoop *loop;
-#endif
/**
* A reference to the thread that is currently inside Run().
@@ -111,7 +93,6 @@ class EventLoop final
ThreadId thread;
public:
-#ifdef USE_INTERNAL_EVENTLOOP
struct Default {};
EventLoop(Default dummy=Default());
@@ -179,47 +160,6 @@ private:
virtual bool OnSocketReady(unsigned flags) override;
public:
-#endif
-
-#ifdef USE_GLIB_EVENTLOOP
- EventLoop()
- :context(g_main_context_new()),
- loop(g_main_loop_new(context, false)),
- thread(ThreadId::Null()) {}
-
- struct Default {};
- EventLoop(gcc_unused Default _dummy)
- :context(g_main_context_ref(g_main_context_default())),
- loop(g_main_loop_new(context, false)),
- thread(ThreadId::Null()) {}
-
- ~EventLoop() {
- g_main_loop_unref(loop);
- g_main_context_unref(context);
- }
-
- GMainContext *GetContext() {
- return context;
- }
-
- void WakeUp() {
- g_main_context_wakeup(context);
- }
-
- void Break() {
- g_main_loop_quit(loop);
- }
-
- void Run();
-
- guint AddIdle(GSourceFunc function, gpointer data);
-
- GSource *AddTimeout(guint interval_ms,
- GSourceFunc function, gpointer data);
-
- GSource *AddTimeoutSeconds(guint interval_s,
- GSourceFunc function, gpointer data);
-#endif
/**
* Are we currently running inside this EventLoop's thread?