summaryrefslogtreecommitdiff
path: root/util/mutexlock.h
diff options
context:
space:
mode:
authorVictor Costan <costan@google.com>2022-01-10 09:48:52 -0800
committerGitHub <noreply@github.com>2022-01-10 09:48:52 -0800
commit3ab94e7da853e1c507e7ce5bcf48a6b887625f62 (patch)
tree2b2ee2b9a79636392a0380befc959ab17555471a /util/mutexlock.h
parent3ee04c5ceae6535e922521ed940411a0318fdd3b (diff)
parent8ccb79b57e877cb28b751d74e3e50bb4f8184997 (diff)
downloadleveldb-3ab94e7da853e1c507e7ce5bcf48a6b887625f62.tar.gz
Merge branch 'master' into fix_issue_505
Diffstat (limited to 'util/mutexlock.h')
-rw-r--r--util/mutexlock.h12
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_