Lines Matching refs:mutex_
176 MutexType mutex_;
204 Mutex::Mutex() : mutex_(0) { } in Mutex()
205 Mutex::~Mutex() { assert(mutex_ == 0); } in ~Mutex()
206 void Mutex::Lock() { assert(--mutex_ == -1); } in Lock()
207 void Mutex::Unlock() { assert(mutex_++ == -1); } in Unlock()
209 bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; } in TryLock()
211 void Mutex::ReaderLock() { assert(++mutex_ > 0); } in ReaderLock()
212 void Mutex::ReaderUnlock() { assert(mutex_-- > 0); } in ReaderUnlock()
216 Mutex::Mutex() { InitializeCriticalSection(&mutex_); SetIsSafe(); } in Mutex()
217 Mutex::~Mutex() { DeleteCriticalSection(&mutex_); } in ~Mutex()
218 void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); } in Lock()
219 void Mutex::Unlock() { if (is_safe_) LeaveCriticalSection(&mutex_); } in Unlock()
222 TryEnterCriticalSection(&mutex_) != 0 : true; } in TryLock()
230 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
235 if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort(); in Mutex()
242 pthread_rwlock_trywrlock(&mutex_) == 0 : in TryLock()
252 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
257 if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort(); in Mutex()
264 pthread_mutex_trylock(&mutex_) == 0 : true; } in TryLock()