From ff665b37cb92e2a1664bbab207030a1eedfbb036 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2014 19:16:30 +0100 Subject: db/DatabaseListener: add method OnDatabaseSongRemoved() Decouples db/update/Remove.cpp from global variables. --- src/db/update/Remove.hxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/db/update/Remove.hxx') diff --git a/src/db/update/Remove.hxx b/src/db/update/Remove.hxx index 1970c0a07..5c09f55df 100644 --- a/src/db/update/Remove.hxx +++ b/src/db/update/Remove.hxx @@ -26,20 +26,23 @@ #include "thread/Cond.hxx" struct Song; +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 { + DatabaseListener &listener; + Mutex remove_mutex; Cond remove_cond; const Song *removed_song; public: - UpdateRemoveService(EventLoop &_loop) - :DeferredMonitor(_loop) {} + UpdateRemoveService(EventLoop &_loop, DatabaseListener &_listener) + :DeferredMonitor(_loop), listener(_listener) {} /** * Sends a signal to the main thread which will in turn remove -- cgit v1.2.3