|
@@ -1,5 +1,7 @@
|
|
#include "shutdown.h"
|
|
#include "shutdown.h"
|
|
|
|
|
|
|
|
+#include <yt/yt/core/concurrency/system_invokers.h>
|
|
|
|
+
|
|
#include <yt/yt/core/misc/collection_helpers.h>
|
|
#include <yt/yt/core/misc/collection_helpers.h>
|
|
#include <yt/yt/core/misc/proc.h>
|
|
#include <yt/yt/core/misc/proc.h>
|
|
#include <yt/yt/core/misc/singleton.h>
|
|
#include <yt/yt/core/misc/singleton.h>
|
|
@@ -177,6 +179,12 @@ public:
|
|
return ShutdownThreadId_.load();
|
|
return ShutdownThreadId_.load();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ void EnsureSystemInvokersRunning() const
|
|
|
|
+ {
|
|
|
|
+ NConcurrency::GetFinalizerInvoker();
|
|
|
|
+ NConcurrency::GetShutdownInvoker();
|
|
|
|
+ }
|
|
|
|
+
|
|
private:
|
|
private:
|
|
std::atomic<FILE*> ShutdownLogFile_ = IsShutdownLoggingEnabledImpl() ? stderr : nullptr;
|
|
std::atomic<FILE*> ShutdownLogFile_ = IsShutdownLoggingEnabledImpl() ? stderr : nullptr;
|
|
|
|
|
|
@@ -275,6 +283,11 @@ size_t GetShutdownThreadId()
|
|
return TShutdownManager::Get()->GetShutdownThreadId();
|
|
return TShutdownManager::Get()->GetShutdownThreadId();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void EnsureSafeShutdown()
|
|
|
|
+{
|
|
|
|
+ TShutdownManager::Get()->EnsureSystemInvokersRunning();
|
|
|
|
+}
|
|
|
|
+
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
static const void* ShutdownGuardInitializer = [] {
|
|
static const void* ShutdownGuardInitializer = [] {
|