From c5fa8ed3217a9223f5e36fdda23021a47e0f81ac Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2014 18:42:07 +0100 Subject: db/update/Service: use EventLoop::IsInside() Don't use the global variable "main_thread". --- src/db/update/UpdateGlue.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/db/update/UpdateGlue.cxx b/src/db/update/UpdateGlue.cxx index 43c6a0bbc..40fe68afc 100644 --- a/src/db/update/UpdateGlue.cxx +++ b/src/db/update/UpdateGlue.cxx @@ -31,6 +31,10 @@ #include "thread/Thread.hxx" #include "thread/Util.hxx" +#ifndef NDEBUG +#include "event/Loop.hxx" +#endif + #include inline void @@ -73,7 +77,7 @@ UpdateService::Task(void *ctx) void UpdateService::StartThread(UpdateQueueItem &&i) { - assert(main_thread.IsInside()); + assert(GetEventLoop().IsInside()); progress = UPDATE_PROGRESS_RUNNING; modified = false; @@ -100,7 +104,7 @@ UpdateService::GenerateId() unsigned UpdateService::Enqueue(const char *path, bool discard) { - assert(main_thread.IsInside()); + assert(GetEventLoop().IsInside()); if (progress != UPDATE_PROGRESS_IDLE) { const unsigned id = GenerateId(); -- cgit v1.2.3