From 9ab0a1f5f16b475199540349905e4d79001b8cec Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 7 Aug 2013 22:49:46 +0200 Subject: EventLoop: add methodd IsInside() Track which thread runs the EventLoop and provide a check whether we're currently inside. --- src/event/Loop.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/event/Loop.cxx') 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 -- cgit v1.2.3