• Home
  • Raw
  • Download

Lines Matching refs:mutex_

72   MutexType mutex_;
95 Mutex::Mutex() : mutex_(0) { } in Mutex()
96 Mutex::~Mutex() { assert(mutex_ == 0); } in ~Mutex()
97 void Mutex::Lock() { assert(--mutex_ == -1); } in Lock()
98 void Mutex::Unlock() { assert(mutex_++ == -1); } in Unlock()
99 bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; } in TryLock()
100 void Mutex::ReaderLock() { assert(++mutex_ > 0); } in ReaderLock()
101 void Mutex::ReaderUnlock() { assert(mutex_-- > 0); } in ReaderUnlock()
108 Mutex::Mutex() { SAFE_PTHREAD(pthread_rwlock_init(&mutex_, NULL)); } in Mutex()
109 Mutex::~Mutex() { SAFE_PTHREAD(pthread_rwlock_destroy(&mutex_)); } in ~Mutex()
110 void Mutex::Lock() { SAFE_PTHREAD(pthread_rwlock_wrlock(&mutex_)); } in Lock()
111 void Mutex::Unlock() { SAFE_PTHREAD(pthread_rwlock_unlock(&mutex_)); } in Unlock()
112 bool Mutex::TryLock() { return pthread_rwlock_trywrlock(&mutex_) == 0; } in TryLock()
113 void Mutex::ReaderLock() { SAFE_PTHREAD(pthread_rwlock_rdlock(&mutex_)); } in ReaderLock()
114 void Mutex::ReaderUnlock() { SAFE_PTHREAD(pthread_rwlock_unlock(&mutex_)); } in ReaderUnlock()
123 Mutex::Mutex() { SAFE_PTHREAD(pthread_mutex_init(&mutex_, NULL)); } in Mutex()
124 Mutex::~Mutex() { SAFE_PTHREAD(pthread_mutex_destroy(&mutex_)); } in ~Mutex()
125 void Mutex::Lock() { SAFE_PTHREAD(pthread_mutex_lock(&mutex_)); } in Lock()
126 void Mutex::Unlock() { SAFE_PTHREAD(pthread_mutex_unlock(&mutex_)); } in Unlock()
127 bool Mutex::TryLock() { return pthread_mutex_trylock(&mutex_) == 0; } in TryLock()
134 Mutex::Mutex() { InitializeCriticalSection(&mutex_); } in Mutex()
135 Mutex::~Mutex() { DeleteCriticalSection(&mutex_); } in ~Mutex()
136 void Mutex::Lock() { EnterCriticalSection(&mutex_); } in Lock()
137 void Mutex::Unlock() { LeaveCriticalSection(&mutex_); } in Unlock()
138 bool Mutex::TryLock() { return TryEnterCriticalSection(&mutex_) != 0; } in TryLock()