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

Unified Diff: test/cctest/test-lock.cc

Issue 21087012: Simplify implementation of Mutex. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: No need to guard inclusion of errno.h Created 7 years, 5 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
Index: test/cctest/test-lock.cc
diff --git a/test/cctest/test-lock.cc b/test/cctest/test-lock.cc
index d4387d0f906787ebf12195ad1a789448cfde5b3a..81f7771c7d35121ff790c5398786785bab70d06c 100644
--- a/test/cctest/test-lock.cc
+++ b/test/cctest/test-lock.cc
@@ -40,28 +40,18 @@ using namespace ::v8::internal;
// Simple test of locking logic
TEST(Simple) {
- Mutex* mutex = OS::CreateMutex();
- CHECK_EQ(0, mutex->Lock()); // acquire the lock with the right token
- CHECK_EQ(0, mutex->Unlock()); // can unlock with the right token
- delete mutex;
-}
-
-
-TEST(MultiLock) {
- Mutex* mutex = OS::CreateMutex();
- CHECK_EQ(0, mutex->Lock());
- CHECK_EQ(0, mutex->Unlock());
- delete mutex;
+ Mutex mutex;
+ mutex.Lock(); // acquire the lock with the right token
+ mutex.Unlock(); // can unlock with the right token
}
TEST(ShallowLock) {
- Mutex* mutex = OS::CreateMutex();
- CHECK_EQ(0, mutex->Lock());
- CHECK_EQ(0, mutex->Unlock());
- CHECK_EQ(0, mutex->Lock());
- CHECK_EQ(0, mutex->Unlock());
- delete mutex;
+ Mutex mutex;
+ mutex.Lock();
+ mutex.Unlock();
+ mutex.Lock();
+ mutex.Unlock();
}
« src/mutex.h ('K') | « test/cctest/test-debug.cc ('k') | test/cctest/test-platform-linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698