diff --git a/misc.h b/misc.h index 894344a2..a888deef 100644 --- a/misc.h +++ b/misc.h @@ -219,10 +219,11 @@ struct NewObject //! \brief A memory barrier //! \details MEMORY_BARRIER attempts to ensure reads and writes are completed //! in the absence of a language synchronization point. It is used by the -//! Singleton class if the compiler supports it. The use is provided at the -//! customary check points in a double-checked initialization. -//! \details Internally, MEMORY_BARRIER uses intrinsic(_ReadWriteBarrier), -//! _ReadWriteBarrier() or __asm__("" ::: "memory"). +//! Singleton class if the compiler supports it. The barrier is provided at the +//! customary places in a double-checked initialization. +//! \details Internally, MEMORY_BARRIER uses std::atomic_thread_fence if +//! C++11 atomics are available. Otherwise, intrinsic(_ReadWriteBarrier), +//! _ReadWriteBarrier() or __asm__("" ::: "memory") is used. #define MEMORY_BARRIER ... #else #if defined(CRYPTOPP_CXX11_ATOMICS) @@ -246,8 +247,8 @@ struct NewObject //! \details This class safely initializes a static object in a multithreaded environment. For C++03 //! and below it will do so without using locks for portability. If two threads call Ref() at the same //! time, they may get back different references, and one object may end up being memory leaked. This -//! is by design. For C++11 and above, a standard double-checked locking pattern with memory fences -//! is used. The locks and fences are standard and do not hinder portability. +//! is by design. For C++11 and above, a standard double-checked locking pattern with thread fences +//! are used. The locks and fences are standard and do not hinder portability. //! \sa Double-Checked Locking is Fixed In C++11 template , int instance=0> class Singleton