diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-01-23 19:30:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-29 19:09:21 (GMT) |
commit | b05b778a2dfbcb6978d652dfa27bd52cc649f736 (patch) | |
tree | 93eb16efaa0aa9209a47e48ee7cedea1753dc88a /Source/cm_thread.hxx | |
parent | d75fec5a88f81a8c16cdeab46766e92a14d1d3cf (diff) | |
download | CMake-b05b778a2dfbcb6978d652dfa27bd52cc649f736.zip CMake-b05b778a2dfbcb6978d652dfa27bd52cc649f736.tar.gz CMake-b05b778a2dfbcb6978d652dfa27bd52cc649f736.tar.bz2 |
clang-tidy: Use `= delete`
Diffstat (limited to 'Source/cm_thread.hxx')
-rw-r--r-- | Source/cm_thread.hxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cm_thread.hxx b/Source/cm_thread.hxx index 84e6a5c..b1f0645 100644 --- a/Source/cm_thread.hxx +++ b/Source/cm_thread.hxx @@ -11,18 +11,18 @@ namespace cm { class shared_mutex { uv_rwlock_t _M_; - CM_DISABLE_COPY(shared_mutex) public: shared_mutex() { uv_rwlock_init(&_M_); } ~shared_mutex() { uv_rwlock_destroy(&_M_); } - void lock() { uv_rwlock_wrlock(&_M_); } + shared_mutex(shared_mutex const&) = delete; + shared_mutex& operator=(shared_mutex const&) = delete; + void lock() { uv_rwlock_wrlock(&_M_); } void unlock() { uv_rwlock_wrunlock(&_M_); } void lock_shared() { uv_rwlock_rdlock(&_M_); } - void unlock_shared() { uv_rwlock_rdunlock(&_M_); } }; @@ -30,7 +30,6 @@ template <typename T> class shared_lock { T& _mutex; - CM_DISABLE_COPY(shared_lock) public: shared_lock(T& m) @@ -38,7 +37,12 @@ public: { _mutex.lock_shared(); } + ~shared_lock() { _mutex.unlock_shared(); } + + shared_lock(shared_lock const&) = delete; + shared_lock& operator=(shared_lock const&) = delete; }; } + #endif |