diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
commit | 71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch) | |
tree | 5343938942df402b49ec7300a1c25a2d4ccd5821 /include/llvm/Support/RWMutex.h | |
parent | 31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff) |
Diffstat (limited to 'include/llvm/Support/RWMutex.h')
-rw-r--r-- | include/llvm/Support/RWMutex.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/include/llvm/Support/RWMutex.h b/include/llvm/Support/RWMutex.h index e4736b8e24eb..85f4fc09fb87 100644 --- a/include/llvm/Support/RWMutex.h +++ b/include/llvm/Support/RWMutex.h @@ -14,7 +14,7 @@ #ifndef LLVM_SUPPORT_RWMUTEX_H #define LLVM_SUPPORT_RWMUTEX_H -#include "llvm/Support/Compiler.h" +#include "llvm/Config/llvm-config.h" #include "llvm/Support/Threading.h" #include <cassert> @@ -32,6 +32,13 @@ namespace sys { /// @brief Default Constructor. explicit RWMutexImpl(); + /// @} + /// @name Do Not Implement + /// @{ + RWMutexImpl(const RWMutexImpl & original) = delete; + RWMutexImpl &operator=(const RWMutexImpl &) = delete; + /// @} + /// Releases and removes the lock /// @brief Destructor ~RWMutexImpl(); @@ -70,16 +77,8 @@ namespace sys { /// @{ private: #if defined(LLVM_ENABLE_THREADS) && LLVM_ENABLE_THREADS != 0 - void* data_; ///< We don't know what the data will be + void* data_ = nullptr; ///< We don't know what the data will be #endif - - /// @} - /// @name Do Not Implement - /// @{ - private: - RWMutexImpl(const RWMutexImpl & original) = delete; - void operator=(const RWMutexImpl &) = delete; - /// @} }; /// SmartMutex - An R/W mutex with a compile time constant parameter that @@ -93,6 +92,8 @@ namespace sys { public: explicit SmartRWMutex() = default; + SmartRWMutex(const SmartRWMutex<mt_only> & original) = delete; + SmartRWMutex<mt_only> &operator=(const SmartRWMutex<mt_only> &) = delete; bool lock_shared() { if (!mt_only || llvm_is_multithreaded()) @@ -136,10 +137,6 @@ namespace sys { --writers; return true; } - - private: - SmartRWMutex(const SmartRWMutex<mt_only> & original); - void operator=(const SmartRWMutex<mt_only> &); }; typedef SmartRWMutex<false> RWMutex; |