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

Unified Diff: src/platform/mutex.cc

Issue 23548007: Import ConditionVariable class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rename OperandSize enum names. Created 7 years, 3 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/platform/mutex.h ('k') | src/platform/time.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/mutex.cc
diff --git a/src/platform/mutex.cc b/src/platform/mutex.cc
index c8d75c73df79143785b5b26ab4653df428b59450..1a7c69af78ce1d40d55fa2ea65e0202b8a24c831 100644
--- a/src/platform/mutex.cc
+++ b/src/platform/mutex.cc
@@ -101,32 +101,32 @@ static V8_INLINE(bool TryLockNativeHandle(pthread_mutex_t* mutex)) {
#elif V8_OS_WIN
-static V8_INLINE(void InitializeNativeHandle(CRITICAL_SECTION* cs)) {
+static V8_INLINE(void InitializeNativeHandle(PCRITICAL_SECTION cs)) {
InitializeCriticalSection(cs);
}
-static V8_INLINE(void InitializeRecursiveNativeHandle(CRITICAL_SECTION* cs)) {
+static V8_INLINE(void InitializeRecursiveNativeHandle(PCRITICAL_SECTION cs)) {
InitializeCriticalSection(cs);
}
-static V8_INLINE(void DestroyNativeHandle(CRITICAL_SECTION* cs)) {
+static V8_INLINE(void DestroyNativeHandle(PCRITICAL_SECTION cs)) {
DeleteCriticalSection(cs);
}
-static V8_INLINE(void LockNativeHandle(CRITICAL_SECTION* cs)) {
+static V8_INLINE(void LockNativeHandle(PCRITICAL_SECTION cs)) {
EnterCriticalSection(cs);
}
-static V8_INLINE(void UnlockNativeHandle(CRITICAL_SECTION* cs)) {
+static V8_INLINE(void UnlockNativeHandle(PCRITICAL_SECTION cs)) {
LeaveCriticalSection(cs);
}
-static V8_INLINE(bool TryLockNativeHandle(CRITICAL_SECTION* cs)) {
+static V8_INLINE(bool TryLockNativeHandle(PCRITICAL_SECTION cs)) {
return TryEnterCriticalSection(cs);
}
@@ -149,18 +149,12 @@ Mutex::~Mutex() {
void Mutex::Lock() {
LockNativeHandle(&native_handle_);
-#ifdef DEBUG
- ASSERT_EQ(0, level_);
- level_++;
-#endif
+ AssertUnheldAndMark();
}
void Mutex::Unlock() {
-#ifdef DEBUG
- ASSERT_EQ(1, level_);
- level_--;
-#endif
+ AssertHeldAndUnmark();
UnlockNativeHandle(&native_handle_);
}
@@ -169,10 +163,7 @@ bool Mutex::TryLock() {
if (!TryLockNativeHandle(&native_handle_)) {
return false;
}
-#ifdef DEBUG
- ASSERT_EQ(0, level_);
- level_++;
-#endif
+ AssertUnheldAndMark();
return true;
}
« no previous file with comments | « src/platform/mutex.h ('k') | src/platform/time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698