diff options
author | Max Kellermann <max@duempel.org> | 2013-08-07 22:49:46 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-08 23:04:01 +0200 |
commit | 9ab0a1f5f16b475199540349905e4d79001b8cec (patch) | |
tree | 6ebbce4ce63dcd5bfa7330ce78081171f58046d9 /src/event/Loop.cxx | |
parent | c043b337b1747498fb2bf3180decdee4561d0d91 (diff) | |
download | mpd-9ab0a1f5f16b475199540349905e4d79001b8cec.tar.gz mpd-9ab0a1f5f16b475199540349905e4d79001b8cec.tar.xz mpd-9ab0a1f5f16b475199540349905e4d79001b8cec.zip |
EventLoop: add methodd IsInside()
Track which thread runs the EventLoop and provide a check whether
we're currently inside.
Diffstat (limited to 'src/event/Loop.cxx')
-rw-r--r-- | src/event/Loop.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx index 1aaca8820..ad20245de 100644 --- a/src/event/Loop.cxx +++ b/src/event/Loop.cxx @@ -23,7 +23,12 @@ void EventLoop::Run() { + assert(thread == nullptr); + thread = g_thread_self(); + g_main_loop_run(loop); + + assert(thread == g_thread_self()); } guint |