Index: base/synchronization/condition_variable_posix.cc |
diff --git a/base/synchronization/condition_variable_posix.cc b/base/synchronization/condition_variable_posix.cc |
index 8492a01fbc56add4847fdb4f6f93c966610b6c6e..013284c888f72993b81a75f0b56a28bd653e6e3a 100644 |
--- a/base/synchronization/condition_variable_posix.cc |
+++ b/base/synchronization/condition_variable_posix.cc |
@@ -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 |
} |