diff options
author | Max Kellermann <max@duempel.org> | 2014-02-04 18:42:07 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-04 18:54:45 +0100 |
commit | c5fa8ed3217a9223f5e36fdda23021a47e0f81ac (patch) | |
tree | 4272a2897a9c448e9813572c01924aa607971379 /src | |
parent | abc16b919ddb5f1d7d76774691b7d664ca5ef3ea (diff) | |
download | mpd-c5fa8ed3217a9223f5e36fdda23021a47e0f81ac.tar.gz mpd-c5fa8ed3217a9223f5e36fdda23021a47e0f81ac.tar.xz mpd-c5fa8ed3217a9223f5e36fdda23021a47e0f81ac.zip |
db/update/Service: use EventLoop::IsInside()
Don't use the global variable "main_thread".
Diffstat (limited to '')
-rw-r--r-- | src/db/update/UpdateGlue.cxx | 8 |
1 files 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 <assert.h> 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(); |