Lines Matching refs:mutex_
177 MutexType mutex_;
200 // but only one writer. We represent this by having mutex_ be -1 when
207 Mutex::Mutex() : mutex_(0) { }
208 Mutex::Mutex(Mutex::LinkerInitialized) : mutex_(0) { }
209 Mutex::~Mutex() { assert(mutex_ == 0); }
210 void Mutex::Lock() { assert(--mutex_ == -1); }
211 void Mutex::Unlock() { assert(mutex_++ == -1); }
212 bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; }
213 void Mutex::ReaderLock() { assert(++mutex_ > 0); }
214 void Mutex::ReaderUnlock() { assert(mutex_-- > 0); }
219 InitializeCriticalSection(&mutex_);
223 InitializeCriticalSection(&mutex_);
226 Mutex::~Mutex() { if (destroy_) DeleteCriticalSection(&mutex_); }
227 void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); }
228 void Mutex::Unlock() { if (is_safe_) LeaveCriticalSection(&mutex_); }
230 TryEnterCriticalSection(&mutex_) != 0 : true; }
237 if (is_safe_ && fncall(&mutex_) != 0) tcmalloc::Abort(); \
242 if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) tcmalloc::Abort();
246 if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) tcmalloc::Abort();
252 pthread_rwlock_trywrlock(&mutex_) == 0 : true; }
260 if (is_safe_ && fncall(&mutex_) != 0) tcmalloc::Abort(); \
265 if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) tcmalloc::Abort();
269 if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) tcmalloc::Abort();
275 pthread_mutex_trylock(&mutex_) == 0 : true; }