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

Unified Diff: test/cctest/test-circular-queue.cc

Issue 23748003: Cleanup Semaphore class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Build fix for Mac OS X. 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 | « test/cctest/test-api.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-circular-queue.cc
diff --git a/test/cctest/test-circular-queue.cc b/test/cctest/test-circular-queue.cc
index 7b21d1e4d0bbf1dc129a9341a9f7f5768456f502..1d6775d9e9fba5aa8a16c813b6631593280c4248 100644
--- a/test/cctest/test-circular-queue.cc
+++ b/test/cctest/test-circular-queue.cc
@@ -142,15 +142,15 @@ TEST(SamplingCircularQueueMultithreading) {
const int kRecordsPerChunk = 4;
TestSampleQueue scq;
- i::Semaphore* semaphore = i::OS::CreateSemaphore(0);
+ i::Semaphore semaphore(0);
- ProducerThread producer1(&scq, kRecordsPerChunk, 1, semaphore);
- ProducerThread producer2(&scq, kRecordsPerChunk, 10, semaphore);
- ProducerThread producer3(&scq, kRecordsPerChunk, 20, semaphore);
+ ProducerThread producer1(&scq, kRecordsPerChunk, 1, &semaphore);
+ ProducerThread producer2(&scq, kRecordsPerChunk, 10, &semaphore);
+ ProducerThread producer3(&scq, kRecordsPerChunk, 20, &semaphore);
CHECK_EQ(NULL, scq.StartDequeue());
producer1.Start();
- semaphore->Wait();
+ semaphore.Wait();
for (Record i = 1; i < 1 + kRecordsPerChunk; ++i) {
Record* rec = reinterpret_cast<Record*>(scq.StartDequeue());
CHECK_NE(NULL, rec);
@@ -162,7 +162,7 @@ TEST(SamplingCircularQueueMultithreading) {
CHECK_EQ(NULL, scq.StartDequeue());
producer2.Start();
- semaphore->Wait();
+ semaphore.Wait();
for (Record i = 10; i < 10 + kRecordsPerChunk; ++i) {
Record* rec = reinterpret_cast<Record*>(scq.StartDequeue());
CHECK_NE(NULL, rec);
@@ -174,7 +174,7 @@ TEST(SamplingCircularQueueMultithreading) {
CHECK_EQ(NULL, scq.StartDequeue());
producer3.Start();
- semaphore->Wait();
+ semaphore.Wait();
for (Record i = 20; i < 20 + kRecordsPerChunk; ++i) {
Record* rec = reinterpret_cast<Record*>(scq.StartDequeue());
CHECK_NE(NULL, rec);
@@ -185,6 +185,4 @@ TEST(SamplingCircularQueueMultithreading) {
}
CHECK_EQ(NULL, scq.StartDequeue());
-
- delete semaphore;
}
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698