diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-12-12 02:17:17 +0100 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-01-23 10:41:44 -0500 |
commit | 4786302fb99f930afca1e778255b72c6999ca480 (patch) | |
tree | 8c92a473f0c8772d152561d909fedce4b8ed5d2f /src/leveldb/util/mutexlock.h | |
parent | c429f2b062140843f42b78d70278279c6be74441 (diff) | |
download | bitcoin-4786302fb99f930afca1e778255b72c6999ca480.tar.xz |
Replace leveldb/ with vanilla 1.7.0
Diffstat (limited to 'src/leveldb/util/mutexlock.h')
-rw-r--r-- | src/leveldb/util/mutexlock.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/leveldb/util/mutexlock.h b/src/leveldb/util/mutexlock.h index c3f3306d3e..1ff5a9efa1 100644 --- a/src/leveldb/util/mutexlock.h +++ b/src/leveldb/util/mutexlock.h @@ -6,6 +6,7 @@ #define STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ #include "port/port.h" +#include "port/thread_annotations.h" namespace leveldb { @@ -19,12 +20,13 @@ namespace leveldb { // ... some complex code, possibly with multiple return paths ... // } -class MutexLock { +class SCOPED_LOCKABLE MutexLock { public: - explicit MutexLock(port::Mutex *mu) : mu_(mu) { + explicit MutexLock(port::Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) + : mu_(mu) { this->mu_->Lock(); } - ~MutexLock() { this->mu_->Unlock(); } + ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); } private: port::Mutex *const mu_; |