Index: test/cctest/test-platform-linux.cc |
diff --git a/test/cctest/test-platform-linux.cc b/test/cctest/test-platform-linux.cc |
index 5945241836a9c380ae72a1b35650048724d932d5..6bb2902f41097825e0c5dc130dfd1628598cc295 100644 |
--- a/test/cctest/test-platform-linux.cc |
+++ b/test/cctest/test-platform-linux.cc |
@@ -52,18 +52,18 @@ static void LoopIncrement(Mutex* mutex, int rem) { |
int count = 0; |
int last_count = -1; |
do { |
- mutex->Lock(); |
+ CHECK_EQ(0, mutex->Lock()); |
count = busy_lock_counter; |
- mutex->Unlock(); |
+ CHECK_EQ(0, mutex->Unlock()); |
yield(); |
} while (count % 2 == rem && count < kLockCounterLimit); |
if (count >= kLockCounterLimit) break; |
- mutex->Lock(); |
+ CHECK_EQ(0, mutex->Lock()); |
CHECK_EQ(count, busy_lock_counter); |
CHECK(last_count == -1 || count == last_count + 1); |
busy_lock_counter++; |
last_count = count; |
- mutex->Unlock(); |
+ CHECK_EQ(0, mutex->Unlock()); |
yield(); |
} |
} |
@@ -79,14 +79,15 @@ static void* RunTestBusyLock(void* arg) { |
// increment a variable. |
TEST(BusyLock) { |
pthread_t other; |
- Mutex mutex; |
+ Mutex* mutex = OS::CreateMutex(); |
int thread_created = pthread_create(&other, |
NULL, |
&RunTestBusyLock, |
- &mutex); |
+ mutex); |
CHECK_EQ(0, thread_created); |
- LoopIncrement(&mutex, 1); |
+ LoopIncrement(mutex, 1); |
pthread_join(other, NULL); |
+ delete mutex; |
} |