Home | History | Annotate | Download | only in ceres

Lines Matching refs:mutex_

172   MutexType mutex_;
193 // but only one writer. We represent this by having mutex_ be -1 when
200 Mutex::Mutex() : mutex_(0) { }
201 Mutex::~Mutex() { assert(mutex_ == 0); }
202 void Mutex::Lock() { assert(--mutex_ == -1); }
203 void Mutex::Unlock() { assert(mutex_++ == -1); }
205 bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; }
207 void Mutex::ReaderLock() { assert(++mutex_ > 0); }
208 void Mutex::ReaderUnlock() { assert(mutex_-- > 0); }
212 Mutex::Mutex() { InitializeCriticalSection(&mutex_); SetIsSafe(); }
213 Mutex::~Mutex() { DeleteCriticalSection(&mutex_); }
214 void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); }
215 void Mutex::Unlock() { if (is_safe_) LeaveCriticalSection(&mutex_); }
218 TryEnterCriticalSection(&mutex_) != 0 : true; }
226 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
231 if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort();
238 pthread_rwlock_trywrlock(&mutex_) == 0 :
248 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
253 if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort();
260 pthread_mutex_trylock(&mutex_) == 0 : true; }