EventLoop: add methodd IsInside()

Track which thread runs the EventLoop and provide a check whether
we're currently inside.
This commit is contained in:
Max Kellermann
2013-08-07 22:49:46 +02:00
parent c043b337b1
commit 9ab0a1f5f1
2 changed files with 26 additions and 2 deletions

View File

@@ -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