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

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

Issue 430503007: Rename ASSERT* to DCHECK*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and fixes Created 6 years, 4 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 | « src/base/platform/mutex.h ('k') | src/base/platform/platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/mutex.cc
diff --git a/src/base/platform/mutex.cc b/src/base/platform/mutex.cc
index 700093e4f654136cbfdb8959e4dde9303a88cbec..8b1e305701ffcc86190b7f53063a2ca5207a3a41 100644
--- a/src/base/platform/mutex.cc
+++ b/src/base/platform/mutex.cc
@@ -17,17 +17,17 @@ static V8_INLINE void InitializeNativeHandle(pthread_mutex_t* mutex) {
// Use an error checking mutex in debug mode.
pthread_mutexattr_t attr;
result = pthread_mutexattr_init(&attr);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
result = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
result = pthread_mutex_init(mutex, &attr);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
result = pthread_mutexattr_destroy(&attr);
#else
// Use a fast mutex (default attributes).
result = pthread_mutex_init(mutex, NULL);
#endif // defined(DEBUG)
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
USE(result);
}
@@ -35,34 +35,34 @@ static V8_INLINE void InitializeNativeHandle(pthread_mutex_t* mutex) {
static V8_INLINE void InitializeRecursiveNativeHandle(pthread_mutex_t* mutex) {
pthread_mutexattr_t attr;
int result = pthread_mutexattr_init(&attr);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
result = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
result = pthread_mutex_init(mutex, &attr);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
result = pthread_mutexattr_destroy(&attr);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
USE(result);
}
static V8_INLINE void DestroyNativeHandle(pthread_mutex_t* mutex) {
int result = pthread_mutex_destroy(mutex);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
USE(result);
}
static V8_INLINE void LockNativeHandle(pthread_mutex_t* mutex) {
int result = pthread_mutex_lock(mutex);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
USE(result);
}
static V8_INLINE void UnlockNativeHandle(pthread_mutex_t* mutex) {
int result = pthread_mutex_unlock(mutex);
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
USE(result);
}
@@ -72,7 +72,7 @@ static V8_INLINE bool TryLockNativeHandle(pthread_mutex_t* mutex) {
if (result == EBUSY) {
return false;
}
- ASSERT_EQ(0, result);
+ DCHECK_EQ(0, result);
return true;
}
@@ -120,7 +120,7 @@ Mutex::Mutex() {
Mutex::~Mutex() {
DestroyNativeHandle(&native_handle_);
- ASSERT_EQ(0, level_);
+ DCHECK_EQ(0, level_);
}
@@ -155,14 +155,14 @@ RecursiveMutex::RecursiveMutex() {
RecursiveMutex::~RecursiveMutex() {
DestroyNativeHandle(&native_handle_);
- ASSERT_EQ(0, level_);
+ DCHECK_EQ(0, level_);
}
void RecursiveMutex::Lock() {
LockNativeHandle(&native_handle_);
#ifdef DEBUG
- ASSERT_LE(0, level_);
+ DCHECK_LE(0, level_);
level_++;
#endif
}
@@ -170,7 +170,7 @@ void RecursiveMutex::Lock() {
void RecursiveMutex::Unlock() {
#ifdef DEBUG
- ASSERT_LT(0, level_);
+ DCHECK_LT(0, level_);
level_--;
#endif
UnlockNativeHandle(&native_handle_);
@@ -182,7 +182,7 @@ bool RecursiveMutex::TryLock() {
return false;
}
#ifdef DEBUG
- ASSERT_LE(0, level_);
+ DCHECK_LE(0, level_);
level_++;
#endif
return true;
« no previous file with comments | « src/base/platform/mutex.h ('k') | src/base/platform/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698