Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / base / synchronization / condition_variable_posix.cc
index 8492a01..013284c 100644 (file)
@@ -16,7 +16,7 @@ namespace base {
 
 ConditionVariable::ConditionVariable(Lock* user_lock)
     : user_mutex_(user_lock->lock_.native_handle())
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
     , user_lock_(user_lock)
 #endif
 {
@@ -48,12 +48,12 @@ ConditionVariable::~ConditionVariable() {
 
 void ConditionVariable::Wait() {
   base::ThreadRestrictions::AssertWaitAllowed();
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
   user_lock_->CheckHeldAndUnmark();
 #endif
   int rv = pthread_cond_wait(&condition_, user_mutex_);
   DCHECK_EQ(0, rv);
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
   user_lock_->CheckUnheldAndMark();
 #endif
 }
@@ -66,7 +66,7 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
   relative_time.tv_nsec =
       (usecs % Time::kMicrosecondsPerSecond) * Time::kNanosecondsPerMicrosecond;
 
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
   user_lock_->CheckHeldAndUnmark();
 #endif
 
@@ -104,7 +104,7 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
 #endif  // OS_MACOSX
 
   DCHECK(rv == 0 || rv == ETIMEDOUT);
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
   user_lock_->CheckUnheldAndMark();
 #endif
 }