From f31920e0929244b312f2a64af150a125ae00e34b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Oct 2021 09:25:12 +0200 Subject: [PATCH] event/Loop: add thread assert() to AddDefer() Currently fails in class NfsFileReader due to https://github.com/MusicPlayerDaemon/MPD/issues/1298 --- src/event/Loop.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx index 630b7fb8b..31049a057 100644 --- a/src/event/Loop.cxx +++ b/src/event/Loop.cxx @@ -175,6 +175,10 @@ EventLoop::HandleTimers() noexcept void EventLoop::AddDefer(DeferEvent &d) noexcept { +#ifdef HAVE_THREADED_EVENT_LOOP + assert(!IsAlive() || IsInside()); +#endif + defer.push_back(d); again = true; }