diff options
author | Max Kellermann <max@duempel.org> | 2014-02-04 19:16:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-04 19:53:37 +0100 |
commit | ff665b37cb92e2a1664bbab207030a1eedfbb036 (patch) | |
tree | 1325b9260c35080b5140eed90a65211276aa946c /src/db/update/Remove.hxx | |
parent | ce738430147427b3bb44063a96cedbae4c53a03d (diff) | |
download | mpd-ff665b37cb92e2a1664bbab207030a1eedfbb036.tar.gz mpd-ff665b37cb92e2a1664bbab207030a1eedfbb036.tar.xz mpd-ff665b37cb92e2a1664bbab207030a1eedfbb036.zip |
db/DatabaseListener: add method OnDatabaseSongRemoved()
Decouples db/update/Remove.cpp from global variables.
Diffstat (limited to '')
-rw-r--r-- | src/db/update/Remove.hxx | 7 |
1 files changed, 5 insertions, 2 deletions
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 |