diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-05-29 17:21:56 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-05-29 17:22:07 -0400 |
commit | fa9c67559186f5416c1c0b26c0a1d5e72c234ccb (patch) | |
tree | 2d1978db3244baeaf39831857bb9929cf9740dfa /src/support | |
parent | cb88de3e3d37842199a17ba3d36838fc69fbe573 (diff) |
Limit scope of all global std::once_flag
Diffstat (limited to 'src/support')
-rw-r--r-- | src/support/lockedpool.cpp | 1 | ||||
-rw-r--r-- | src/support/lockedpool.h | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/support/lockedpool.cpp b/src/support/lockedpool.cpp index f17b539e09..b4f392116c 100644 --- a/src/support/lockedpool.cpp +++ b/src/support/lockedpool.cpp @@ -29,7 +29,6 @@ #endif LockedPoolManager* LockedPoolManager::_instance = nullptr; -std::once_flag LockedPoolManager::init_flag; /*******************************************************************************/ // Utilities diff --git a/src/support/lockedpool.h b/src/support/lockedpool.h index de668f0773..b9e2e99d1a 100644 --- a/src/support/lockedpool.h +++ b/src/support/lockedpool.h @@ -221,7 +221,8 @@ public: /** Return the current instance, or create it once */ static LockedPoolManager& Instance() { - std::call_once(LockedPoolManager::init_flag, LockedPoolManager::CreateInstance); + static std::once_flag init_flag; + std::call_once(init_flag, LockedPoolManager::CreateInstance); return *LockedPoolManager::_instance; } @@ -234,7 +235,6 @@ private: static bool LockingFailed(); static LockedPoolManager* _instance; - static std::once_flag init_flag; }; #endif // BITCOIN_SUPPORT_LOCKEDPOOL_H |