diff options
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 |