event/DeferEvent: split the thread-safe version into new class InjectEvent

This commit is contained in:
Max Kellermann
2020-12-01 16:25:11 +01:00
parent 1ecbc2ff0f
commit 774b4313f2
22 changed files with 226 additions and 68 deletions

View File

@@ -37,7 +37,7 @@
#include "util/ConstBuffer.hxx"
#include "util/StringView.hxx"
#include "event/MultiSocketMonitor.hxx"
#include "event/DeferEvent.hxx"
#include "event/InjectEvent.hxx"
#include "event/Call.hxx"
#include "Log.hxx"
@@ -55,7 +55,7 @@ static constexpr unsigned MPD_ALSA_BUFFER_TIME_US = 500000;
class AlsaOutput final
: AudioOutput, MultiSocketMonitor {
DeferEvent defer_invalidate_sockets;
InjectEvent defer_invalidate_sockets;
/**
* This timer is used to re-schedule the #MultiSocketMonitor

View File

@@ -31,7 +31,7 @@
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "event/ServerSocket.hxx"
#include "event/DeferEvent.hxx"
#include "event/InjectEvent.hxx"
#include "util/Cast.hxx"
#include "util/Compiler.h"
@@ -115,7 +115,7 @@ private:
*/
std::queue<PagePtr, std::list<PagePtr>> pages;
DeferEvent defer_broadcast;
InjectEvent defer_broadcast;
public:
/**
@@ -269,7 +269,7 @@ public:
bool Pause() override;
private:
/* DeferEvent callback */
/* InjectEvent callback */
void OnDeferredBroadcast() noexcept;
void OnAccept(UniqueSocketDescriptor fd,