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

Unified Diff: src/base/platform/mutex.cc

Issue 769263002: Add support for enabling DCHECKs in release mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years 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
Index: src/base/platform/mutex.cc
diff --git a/src/base/platform/mutex.cc b/src/base/platform/mutex.cc
index 8b1e305701ffcc86190b7f53063a2ca5207a3a41..c781260f1f0f7706479424adf1f92f4717c16a2f 100644
--- a/src/base/platform/mutex.cc
+++ b/src/base/platform/mutex.cc
@@ -112,7 +112,7 @@ static V8_INLINE bool TryLockNativeHandle(PCRITICAL_SECTION cs) {
Mutex::Mutex() {
InitializeNativeHandle(&native_handle_);
-#ifdef DEBUG
+#if DCHECK_IS_ON
level_ = 0;
#endif
}
@@ -147,7 +147,7 @@ bool Mutex::TryLock() {
RecursiveMutex::RecursiveMutex() {
InitializeRecursiveNativeHandle(&native_handle_);
-#ifdef DEBUG
+#if DCHECK_IS_ON
level_ = 0;
#endif
}
@@ -161,7 +161,7 @@ RecursiveMutex::~RecursiveMutex() {
void RecursiveMutex::Lock() {
LockNativeHandle(&native_handle_);
-#ifdef DEBUG
+#if DCHECK_IS_ON
DCHECK_LE(0, level_);
level_++;
#endif
@@ -169,7 +169,7 @@ void RecursiveMutex::Lock() {
void RecursiveMutex::Unlock() {
-#ifdef DEBUG
+#if DCHECK_IS_ON
DCHECK_LT(0, level_);
level_--;
#endif
@@ -181,7 +181,7 @@ bool RecursiveMutex::TryLock() {
if (!TryLockNativeHandle(&native_handle_)) {
return false;
}
-#ifdef DEBUG
+#if DCHECK_IS_ON
DCHECK_LE(0, level_);
level_++;
#endif

Powered by Google App Engine
This is Rietveld 408576698