diff options
author | gengjiawen <technicalcute@gmail.com> | 2019-03-13 17:56:39 +0300 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2019-03-18 04:58:22 +0300 |
commit | b215bf9dacde65f7904fe87586547b9a8ac5f950 (patch) | |
tree | bd3f11396300fb8354d1fe8e949d9380ebe8f51c /src/node_mutex.h | |
parent | ed60e863e74786dfb1f868f2a17c939843b64c25 (diff) |
src: inline macro DISALLOW_COPY_AND_ASSIGN
PR-URL: https://github.com/nodejs/node/pull/26634
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/node_mutex.h')
-rw-r--r-- | src/node_mutex.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/node_mutex.h b/src/node_mutex.h index de62a0d9ff6..807e1444f1e 100644 --- a/src/node_mutex.h +++ b/src/node_mutex.h @@ -23,6 +23,9 @@ class MutexBase { inline void Lock(); inline void Unlock(); + MutexBase(const MutexBase&) = delete; + MutexBase& operator=(const MutexBase&) = delete; + class ScopedLock; class ScopedUnlock; @@ -32,11 +35,13 @@ class MutexBase { inline explicit ScopedLock(const ScopedUnlock& scoped_unlock); inline ~ScopedLock(); + ScopedLock(const ScopedLock&) = delete; + ScopedLock& operator=(const ScopedLock&) = delete; + private: template <typename> friend class ConditionVariableBase; friend class ScopedUnlock; const MutexBase& mutex_; - DISALLOW_COPY_AND_ASSIGN(ScopedLock); }; class ScopedUnlock { @@ -44,16 +49,17 @@ class MutexBase { inline explicit ScopedUnlock(const ScopedLock& scoped_lock); inline ~ScopedUnlock(); + ScopedUnlock(const ScopedUnlock&) = delete; + ScopedUnlock& operator=(const ScopedUnlock&) = delete; + private: friend class ScopedLock; const MutexBase& mutex_; - DISALLOW_COPY_AND_ASSIGN(ScopedUnlock); }; private: template <typename> friend class ConditionVariableBase; mutable typename Traits::MutexT mutex_; - DISALLOW_COPY_AND_ASSIGN(MutexBase); }; template <typename Traits> @@ -67,9 +73,11 @@ class ConditionVariableBase { inline void Signal(const ScopedLock&); inline void Wait(const ScopedLock& scoped_lock); + ConditionVariableBase(const ConditionVariableBase&) = delete; + ConditionVariableBase& operator=(const ConditionVariableBase&) = delete; + private: typename Traits::CondT cond_; - DISALLOW_COPY_AND_ASSIGN(ConditionVariableBase); }; struct LibuvMutexTraits { |