Home | History | Annotate | Download | only in src

Lines Matching refs:mutex_

187   MutexType mutex_;
210 // but only one writer. We represent this by having mutex_ be -1 when
217 Mutex::Mutex() : mutex_(0) { }
218 Mutex::Mutex(Mutex::LinkerInitialized) : mutex_(0) { }
219 Mutex::~Mutex() { assert(mutex_ == 0); }
220 void Mutex::Lock() { assert(--mutex_ == -1); }
221 void Mutex::Unlock() { assert(mutex_++ == -1); }
223 bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; }
225 void Mutex::ReaderLock() { assert(++mutex_ > 0); }
226 void Mutex::ReaderUnlock() { assert(mutex_-- > 0); }
231 InitializeCriticalSection(&mutex_);
235 InitializeCriticalSection(&mutex_);
238 Mutex::~Mutex() { if (destroy_) DeleteCriticalSection(&mutex_); }
239 void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); }
240 void Mutex::Unlock() { if (is_safe_) LeaveCriticalSection(&mutex_); }
243 TryEnterCriticalSection(&mutex_) != 0 : true; }
251 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
256 if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort();
260 if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort();
267 pthread_rwlock_trywrlock(&mutex_) == 0 : true; }
276 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
281 if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort();
285 if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort();
292 pthread_mutex_trylock(&mutex_) == 0 : true; }