diff options
author | Victor Costan <costan@google.com> | 2022-01-10 09:48:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 09:48:52 -0800 |
commit | 3ab94e7da853e1c507e7ce5bcf48a6b887625f62 (patch) | |
tree | 2b2ee2b9a79636392a0380befc959ab17555471a /util/mutexlock.h | |
parent | 3ee04c5ceae6535e922521ed940411a0318fdd3b (diff) | |
parent | 8ccb79b57e877cb28b751d74e3e50bb4f8184997 (diff) | |
download | leveldb-3ab94e7da853e1c507e7ce5bcf48a6b887625f62.tar.gz |
Merge branch 'master' into fix_issue_505
Diffstat (limited to 'util/mutexlock.h')
-rw-r--r-- | util/mutexlock.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/util/mutexlock.h b/util/mutexlock.h index 1ff5a9e..0cb2e25 100644 --- a/util/mutexlock.h +++ b/util/mutexlock.h @@ -22,20 +22,18 @@ namespace leveldb { class SCOPED_LOCKABLE MutexLock { public: - explicit MutexLock(port::Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) - : mu_(mu) { + explicit MutexLock(port::Mutex* mu) EXCLUSIVE_LOCK_FUNCTION(mu) : mu_(mu) { this->mu_->Lock(); } ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); } + MutexLock(const MutexLock&) = delete; + MutexLock& operator=(const MutexLock&) = delete; + private: - port::Mutex *const mu_; - // No copying allowed - MutexLock(const MutexLock&); - void operator=(const MutexLock&); + port::Mutex* const mu_; }; } // namespace leveldb - #endif // STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ |