diff --git a/src/event/Call.cxx b/src/event/Call.cxx index f3eb82235..938ce70bb 100644 --- a/src/event/Call.cxx +++ b/src/event/Call.cxx @@ -20,7 +20,7 @@ #include "config.h" #include "Call.hxx" #include "Loop.hxx" -#include "DeferredMonitor.hxx" +#include "DeferEvent.hxx" #include "thread/Mutex.hxx" #include "thread/Cond.hxx" #include "Compiler.h" @@ -30,8 +30,9 @@ #include class BlockingCallMonitor final - : DeferredMonitor { + DeferEvent defer_event; + const std::function f; Mutex mutex; @@ -43,12 +44,13 @@ class BlockingCallMonitor final public: BlockingCallMonitor(EventLoop &_loop, std::function &&_f) - :DeferredMonitor(_loop), f(std::move(_f)), done(false) {} + :defer_event(_loop, BIND_THIS_METHOD(RunDeferred)), + f(std::move(_f)), done(false) {} void Run() { assert(!done); - Schedule(); + defer_event.Schedule(); mutex.lock(); while (!done) @@ -60,7 +62,7 @@ public: } private: - virtual void RunDeferred() override { + void RunDeferred() noexcept { assert(!done); try {