diff options
Diffstat (limited to 'indra/llcommon/llsingleton.cpp')
| -rw-r--r-- | indra/llcommon/llsingleton.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index 05dc3cde79..46659e6b7b 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -27,6 +27,8 @@ #include "linden_common.h" #include "llsingleton.h" +#include <atomic> + #include "llerror.h" #include "llerrorcontrol.h" #include "lldependencies.h" @@ -406,8 +408,19 @@ void LLSingletonBase::cleanup_() } //static +namespace +{ + std::atomic<bool> sShuttingDown{false}; +} + +bool LLSingletonBase::shuttingDown() +{ + return sShuttingDown.load(std::memory_order_acquire); +} + void LLSingletonBase::deleteAll() { + sShuttingDown.store(true, std::memory_order_release); // It's essential to traverse these in dependency order. for (LLSingletonBase* sp : dep_sort()) { |
