Commit c5fa8ed3 authored by Max Kellermann's avatar Max Kellermann

db/update/Service: use EventLoop::IsInside()

Don't use the global variable "main_thread".
parent abc16b91
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
#include "thread/Thread.hxx" #include "thread/Thread.hxx"
#include "thread/Util.hxx" #include "thread/Util.hxx"
#ifndef NDEBUG
#include "event/Loop.hxx"
#endif
#include <assert.h> #include <assert.h>
inline void inline void
...@@ -73,7 +77,7 @@ UpdateService::Task(void *ctx) ...@@ -73,7 +77,7 @@ UpdateService::Task(void *ctx)
void void
UpdateService::StartThread(UpdateQueueItem &&i) UpdateService::StartThread(UpdateQueueItem &&i)
{ {
assert(main_thread.IsInside()); assert(GetEventLoop().IsInside());
progress = UPDATE_PROGRESS_RUNNING; progress = UPDATE_PROGRESS_RUNNING;
modified = false; modified = false;
...@@ -100,7 +104,7 @@ UpdateService::GenerateId() ...@@ -100,7 +104,7 @@ UpdateService::GenerateId()
unsigned unsigned
UpdateService::Enqueue(const char *path, bool discard) UpdateService::Enqueue(const char *path, bool discard)
{ {
assert(main_thread.IsInside()); assert(GetEventLoop().IsInside());
if (progress != UPDATE_PROGRESS_IDLE) { if (progress != UPDATE_PROGRESS_IDLE) {
const unsigned id = GenerateId(); const unsigned id = GenerateId();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment