event/DeferEvent: split the thread-safe version into new class InjectEvent
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#ifndef MPD_UPDATE_REMOVE_HXX
|
||||
#define MPD_UPDATE_REMOVE_HXX
|
||||
|
||||
#include "event/DeferEvent.hxx"
|
||||
#include "event/InjectEvent.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
|
||||
#include <forward_list>
|
||||
@@ -39,7 +39,7 @@ class UpdateRemoveService final {
|
||||
|
||||
std::forward_list<std::string> uris;
|
||||
|
||||
DeferEvent defer;
|
||||
InjectEvent defer;
|
||||
|
||||
public:
|
||||
UpdateRemoveService(EventLoop &_loop, DatabaseListener &_listener)
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
void Remove(std::string &&uri);
|
||||
|
||||
private:
|
||||
/* DeferEvent callback */
|
||||
/* InjectEvent callback */
|
||||
void RunDeferred() noexcept;
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "Config.hxx"
|
||||
#include "Queue.hxx"
|
||||
#include "event/DeferEvent.hxx"
|
||||
#include "event/InjectEvent.hxx"
|
||||
#include "thread/Thread.hxx"
|
||||
#include "util/Compiler.h"
|
||||
|
||||
@@ -40,7 +40,7 @@ class CompositeStorage;
|
||||
class UpdateService final {
|
||||
const UpdateConfig config;
|
||||
|
||||
DeferEvent defer;
|
||||
InjectEvent defer;
|
||||
|
||||
SimpleDatabase &db;
|
||||
CompositeStorage &storage;
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
void CancelMount(const char *uri) noexcept;
|
||||
|
||||
private:
|
||||
/* DeferEvent callback */
|
||||
/* InjectEvent callback */
|
||||
void RunDeferred() noexcept;
|
||||
|
||||
/* the update thread */
|
||||
|
||||
Reference in New Issue
Block a user