event/DeferEvent: split the thread-safe version into new class InjectEvent
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "lib/curl/Escape.hxx"
|
||||
#include "lib/expat/ExpatParser.hxx"
|
||||
#include "fs/Traits.hxx"
|
||||
#include "event/DeferEvent.hxx"
|
||||
#include "event/InjectEvent.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "thread/Cond.hxx"
|
||||
#include "time/Parser.hxx"
|
||||
@@ -84,7 +84,7 @@ CurlStorage::MapToRelativeUTF8(std::string_view uri_utf8) const noexcept
|
||||
}
|
||||
|
||||
class BlockingHttpRequest : protected CurlResponseHandler {
|
||||
DeferEvent defer_start;
|
||||
InjectEvent defer_start;
|
||||
|
||||
std::exception_ptr postponed_error;
|
||||
|
||||
@@ -136,7 +136,7 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
/* DeferEvent callback */
|
||||
/* InjectEvent callback */
|
||||
void OnDeferredStart() noexcept {
|
||||
assert(!done);
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include "thread/Cond.hxx"
|
||||
#include "event/Loop.hxx"
|
||||
#include "event/Call.hxx"
|
||||
#include "event/DeferEvent.hxx"
|
||||
#include "event/InjectEvent.hxx"
|
||||
#include "event/TimerEvent.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
@@ -61,7 +61,7 @@ class NfsStorage final
|
||||
|
||||
NfsConnection *connection;
|
||||
|
||||
DeferEvent defer_connect;
|
||||
InjectEvent defer_connect;
|
||||
TimerEvent reconnect_timer;
|
||||
|
||||
Mutex mutex;
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
reconnect_timer.Schedule(std::chrono::seconds(5));
|
||||
}
|
||||
|
||||
/* DeferEvent callback */
|
||||
/* InjectEvent callback */
|
||||
void OnDeferredConnect() noexcept {
|
||||
if (state == State::INITIAL)
|
||||
Connect();
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include "thread/Cond.hxx"
|
||||
#include "thread/SafeSingleton.hxx"
|
||||
#include "event/Call.hxx"
|
||||
#include "event/DeferEvent.hxx"
|
||||
#include "event/InjectEvent.hxx"
|
||||
#include "fs/AllocatedPath.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
@@ -62,7 +62,7 @@ class UdisksStorage final : public Storage {
|
||||
|
||||
std::exception_ptr mount_error;
|
||||
|
||||
DeferEvent defer_mount, defer_unmount;
|
||||
InjectEvent defer_mount, defer_unmount;
|
||||
|
||||
public:
|
||||
template<typename B, typename I, typename IP>
|
||||
|
Reference in New Issue
Block a user