event/Loop: add thread assert() to AddDefer()

Currently fails in class NfsFileReader due to
https://github.com/MusicPlayerDaemon/MPD/issues/1298
This commit is contained in:
Max Kellermann 2021-10-20 09:25:12 +02:00
parent eb111a10e7
commit f31920e092

View File

@ -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;
}