Lines Matching full:lock
77 // look at the bool, and not try to lock/unlock until the bool makes
84 // state between a call to Lock() and a call to Unlock() (that would
85 // require a global constructor in one translation unit to call Lock()
105 typedef int MutexType; // to keep a lock-count
146 inline void Lock(); // Block if needed until free then acquire exclusively
147 inline void Unlock(); // Release a lock acquired via Lock()
149 inline bool TryLock(); // If free, Lock() and return true, else return false
152 // be implemented as synonyms to Lock() and Unlock(). So you can use
157 inline void WriterLock() { Lock(); } // Acquire an exclusive lock
158 inline void WriterUnlock() { Unlock(); } // Release a lock from WriterLock()
183 // writing and a number > 0 when reading (and 0 when no lock is held).
192 void Mutex::Lock() { assert(--mutex_ == -1); }
195 bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; }
204 void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); }
210 void Mutex::ReaderLock() { Lock(); } // we don't have read-write locks
225 void Mutex::Lock() { SAFE_PTHREAD(pthread_rwlock_wrlock); }
248 void Mutex::Lock() { SAFE_PTHREAD(pthread_mutex_lock); }
254 void Mutex::ReaderLock() { Lock(); }
266 explicit MutexLock(Mutex *mu) : mu_(mu) { mu_->Lock(); }