+/* Destroy and clean-up one singleton. Must be invoked while holding
+ * a read lock on mutex_.
+ * @param typeDescriptor - the type key for the removed singleton.
+ */
+void SingletonVault::destroyInstance(SingletonMap::iterator entry_it) {
+ const auto& type = entry_it->first;
+ auto& entry = *(entry_it->second);
+ if (entry.instance.use_count() > 1) {
+ LOG(ERROR) << "Singleton of type " << type.name() << " has a living "
+ << "reference at destroyInstances time; beware! Raw pointer "
+ << "is " << entry.instance.get() << " with use_count of "
+ << entry.instance.use_count();
+ }
+ entry.state = detail::SingletonEntryState::Dead;
+ entry.instance.reset();
+}
+
+void SingletonVault::reenableInstances() {
+ RWSpinLock::WriteHolder state_wh(&stateMutex_);
+
+ stateCheck(SingletonVaultState::Quiescing);
+
+ state_ = SingletonVaultState::Running;
+}
+