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:
Nik Bougalis
2014-12-22 02:45:36 -08:00
parent c01b4e6baa
commit 1d6721d345
20 changed files with 47 additions and 2229 deletions

View File

@@ -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;
}
}