state_ = SingletonHolderState::Dead;
instance_.reset();
if (destroy_baton_) {
+ constexpr std::chrono::seconds kDestroyWaitTime{5};
auto wait_result = destroy_baton_->timed_wait(
std::chrono::steady_clock::now() + kDestroyWaitTime);
if (!wait_result) {
namespace detail {
-constexpr std::chrono::seconds SingletonHolderBase::kDestroyWaitTime;
-
[[noreturn]] void singletonWarnDoubleRegistrationAndAbort(
const TypeDescriptor& type) {
// Not using LOG(FATAL) or std::cerr because they may not be initialized yet.
virtual void createInstance() = 0;
virtual bool creationStarted() = 0;
virtual void destroyInstance() = 0;
-
- protected:
- static constexpr std::chrono::seconds kDestroyWaitTime{5};
};
// An actual instance of a singleton, tracking the instance itself,