diff --git a/src/db/update/Remove.cxx b/src/db/update/Remove.cxx index c0b183885..765feb7f3 100644 --- a/src/db/update/Remove.cxx +++ b/src/db/update/Remove.cxx @@ -29,7 +29,7 @@ * available only there. */ void -UpdateRemoveService::RunDeferred() +UpdateRemoveService::RunDeferred() noexcept { /* copy the list and unlock the mutex before invoking callbacks */ @@ -65,5 +65,5 @@ UpdateRemoveService::Remove(std::string &&uri) was empty; if it was not, then that even was already pending */ if (was_empty) - DeferredMonitor::Schedule(); + defer.Schedule(); } diff --git a/src/db/update/Remove.hxx b/src/db/update/Remove.hxx index 08996bd8a..d34fa2049 100644 --- a/src/db/update/Remove.hxx +++ b/src/db/update/Remove.hxx @@ -21,7 +21,7 @@ #define MPD_UPDATE_REMOVE_HXX #include "check.h" -#include "event/DeferredMonitor.hxx" +#include "event/DeferEvent.hxx" #include "thread/Mutex.hxx" #include "Compiler.h" @@ -35,16 +35,19 @@ class DatabaseListener; * This class handles #Song removal. It defers the action to the main * thread to ensure that all references to the #Song are gone. */ -class UpdateRemoveService final : DeferredMonitor { +class UpdateRemoveService final { DatabaseListener &listener; Mutex mutex; std::forward_list uris; + DeferEvent defer; + public: UpdateRemoveService(EventLoop &_loop, DatabaseListener &_listener) - :DeferredMonitor(_loop), listener(_listener) {} + :listener(_listener), + defer(_loop, BIND_THIS_METHOD(RunDeferred)) {} /** * Sends a signal to the main thread which will in turn remove @@ -55,8 +58,8 @@ public: void Remove(std::string &&uri); private: - /* virtual methods from class DeferredMonitor */ - virtual void RunDeferred() override; + /* DeferEvent callback */ + void RunDeferred() noexcept; }; #endif