Lines Matching refs:mutex_
161 MutexType mutex_;
190 Mutex::Mutex() : mutex_(0) { } in Mutex()
191 Mutex::~Mutex() { assert(mutex_ == 0); } in ~Mutex()
192 void Mutex::Lock() { assert(--mutex_ == -1); } in Lock()
193 void Mutex::Unlock() { assert(mutex_++ == -1); } in Unlock()
195 bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; } in TryLock()
197 void Mutex::ReaderLock() { assert(++mutex_ > 0); } in ReaderLock()
198 void Mutex::ReaderUnlock() { assert(mutex_-- > 0); } in ReaderUnlock()
202 Mutex::Mutex() { InitializeCriticalSection(&mutex_); SetIsSafe(); } in Mutex()
203 Mutex::~Mutex() { DeleteCriticalSection(&mutex_); } in ~Mutex()
204 void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); } in Lock()
205 void Mutex::Unlock() { if (is_safe_) LeaveCriticalSection(&mutex_); } in Unlock()
208 TryEnterCriticalSection(&mutex_) != 0 : true; } in TryLock()
217 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
222 if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort(); in Mutex()
229 pthread_rwlock_trywrlock(&mutex_) == 0 : in TryLock()
240 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
245 if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort(); in Mutex()
252 pthread_mutex_trylock(&mutex_) == 0 : true; } in TryLock()