Home | History | Annotate | Download | only in ceres

Lines Matching full:is_safe_

90 // that, we set is_safe_ to true in code (not the constructor
177 // We want to make sure that the compiler sets is_safe_ to true only
178 // when we tell it to, and never makes assumptions is_safe_ is
180 volatile bool is_safe_;
182 inline void SetIsSafe() { is_safe_ = true; }
218 void Mutex::Lock() { if (is_safe_) EnterCriticalSection(&mutex_); }
219 void Mutex::Unlock() { if (is_safe_) LeaveCriticalSection(&mutex_); }
221 bool Mutex::TryLock() { return is_safe_ ?
229 #define CERES_SAFE_PTHREAD(fncall) do { /* run fncall if is_safe_ is true */ \
230 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
235 if (is_safe_ && pthread_rwlock_init(&mutex_, NULL) != 0) abort();
241 bool Mutex::TryLock() { return is_safe_ ?
251 #define CERES_SAFE_PTHREAD(fncall) do { /* run fncall if is_safe_ is true */ \
252 if (is_safe_ && fncall(&mutex_) != 0) abort(); \
257 if (is_safe_ && pthread_mutex_init(&mutex_, NULL) != 0) abort();
263 bool Mutex::TryLock() { return is_safe_ ?