mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 17:35:51 +00:00
Reduce Beast dependencies by leveraging C++11 features:
* Remove beast::Atomic (RIPD-728): * Use std-provided alternatives * Eliminate atomic variables where possible * Cleanup beast::Thread interface: * Use std::string instead of beast::String * Remove unused functions and parameters * Remove unused code: * beast::ThreadLocalValue * beast::ServiceQueue
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
#include <beast/smart_ptr/SharedPtr.h>
|
||||
#include <beast/module/core/time/AtExitHook.h>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace beast
|
||||
{
|
||||
|
||||
@@ -99,7 +101,7 @@ public:
|
||||
bassert (lifetime == SingletonLifetime::createOnDemand || ! staticData.destructorCalled);
|
||||
staticData.instance = &staticData.object;
|
||||
new (staticData.instance) SharedSingleton (lifetime);
|
||||
memoryBarrier();
|
||||
std::atomic_thread_fence (std::memory_order_seq_cst);
|
||||
instance = staticData.instance;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user