8#include <config/bitcoin-config.h>
17#include <condition_variable>
23 if (user_message.
empty()) {
25 _(
"A fatal internal error occurred, see debug.log for details");
35std::mutex g_shutdown_mutex;
36std::condition_variable g_shutdown_cv;
57 std::unique_lock<std::mutex> lk(g_shutdown_mutex);
59 g_shutdown_cv.notify_one();
69 LogPrintf(
"Sending shutdown token failed\n");
91 std::unique_lock<std::mutex> lk(g_shutdown_mutex);
96 LogPrintf(
"Reading shutdown token failed\n");
int TokenWrite(uint8_t token)
Write token to endpoint.
int TokenRead()
Read token from endpoint.
static std::optional< TokenPipe > Make()
Create a new pipe.
void WaitForShutdown()
Wait for StartShutdown to be called in any thread.
static TokenPipeEnd g_shutdown_w
bool AbortNode(const std::string &strMessage, bilingual_str user_message)
Abort with a message.
bool ShutdownRequested()
Returns true if a shutdown is requested, false otherwise.
static std::atomic< bool > fRequestShutdown(false)
static TokenPipeEnd g_shutdown_r
On UNIX-like operating systems use the self-pipe trick.
bool InitShutdownState()
Initialize shutdown state.
void StartShutdown()
Request shutdown of the application.
void AbortShutdown()
Clear shutdown flag.
bilingual_str _(const char *psz)
Translation function.
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
constexpr auto AbortError
void SetMiscWarning(const bilingual_str &warning)