Home | History | Annotate | Download | only in util

Lines Matching defs:Lock

19   typedef int MutexType;      // to keep a lock-count
58 inline void Lock(); // Block if needed until free then acquire exclusively
59 inline void Unlock(); // Release a lock acquired via Lock()
60 inline bool TryLock(); // If free, Lock() and return true, else return false
62 // be implemented as synonyms to Lock() and Unlock(). So you can use
67 inline void WriterLock() { Lock(); } // Acquire an exclusive lock
68 inline void WriterUnlock() { Unlock(); } // Release a lock from WriterLock()
88 // writing and a number > 0 when reading (and 0 when no lock is held).
97 void Mutex::Lock() { assert(--mutex_ == -1); }
99 bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; }
110 void Mutex::Lock() { SAFE_PTHREAD(pthread_rwlock_wrlock(&mutex_)); }
125 void Mutex::Lock() { SAFE_PTHREAD(pthread_mutex_lock(&mutex_)); }
128 void Mutex::ReaderLock() { Lock(); } // we don't have read-write locks
136 void Mutex::Lock() { EnterCriticalSection(&mutex_); }
139 void Mutex::ReaderLock() { Lock(); } // we don't have read-write locks
151 explicit MutexLock(Mutex *mu) : mu_(mu) { mu_->Lock(); }
203 name.Lock()