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 @@
#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();
......
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