Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: synchronization/condition_variable_posix.cc

Issue 2045223003: Update to Chromium //base at Chromium commit 82baa9afc6620c68cb2168f20bb65e77e3e57f0a. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « synchronization/condition_variable.h ('k') | synchronization/condition_variable_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: synchronization/condition_variable_posix.cc
diff --git a/synchronization/condition_variable_posix.cc b/synchronization/condition_variable_posix.cc
index c9a2ec43f829e7fdbb73351e8739ad5e699150eb..03f81845dcfc825657d84f63ea09fef2f71d04f5 100644
--- a/synchronization/condition_variable_posix.cc
+++ b/synchronization/condition_variable_posix.cc
@@ -7,7 +7,6 @@
#include <errno.h>
#include <sys/time.h>
-#include "base/logging.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
@@ -16,8 +15,9 @@ namespace base {
ConditionVariable::ConditionVariable(Lock* user_lock)
: user_mutex_(user_lock->lock_.native_handle())
-#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
- , user_lock_(user_lock)
+#if DCHECK_IS_ON()
+ ,
+ user_lock_(user_lock)
#endif
{
int rv = 0;
@@ -62,12 +62,12 @@ ConditionVariable::~ConditionVariable() {
void ConditionVariable::Wait() {
base::ThreadRestrictions::AssertWaitAllowed();
-#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
+#if DCHECK_IS_ON()
user_lock_->CheckHeldAndUnmark();
#endif
int rv = pthread_cond_wait(&condition_, user_mutex_);
DCHECK_EQ(0, rv);
-#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
+#if DCHECK_IS_ON()
user_lock_->CheckUnheldAndMark();
#endif
}
@@ -80,7 +80,7 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
relative_time.tv_nsec =
(usecs % Time::kMicrosecondsPerSecond) * Time::kNanosecondsPerMicrosecond;
-#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
+#if DCHECK_IS_ON()
user_lock_->CheckHeldAndUnmark();
#endif
@@ -118,7 +118,7 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
#endif // OS_MACOSX
DCHECK(rv == 0 || rv == ETIMEDOUT);
-#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
+#if DCHECK_IS_ON()
user_lock_->CheckUnheldAndMark();
#endif
}
« no previous file with comments | « synchronization/condition_variable.h ('k') | synchronization/condition_variable_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698