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

Unified Diff: test/cctest/test-lockers.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-lock.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-lockers.cc
diff --git a/test/cctest/test-lockers.cc b/test/cctest/test-lockers.cc
index 90e1f757803736f05fa62e924d3514332447bfd6..a143d583fd2941622cca1f9318635aa5aecc0ab3 100644
--- a/test/cctest/test-lockers.cc
+++ b/test/cctest/test-lockers.cc
@@ -129,20 +129,18 @@ class JoinableThread {
public:
explicit JoinableThread(const char* name)
: name_(name),
- semaphore_(i::OS::CreateSemaphore(0)),
+ semaphore_(0),
thread_(this) {
}
- virtual ~JoinableThread() {
- delete semaphore_;
- }
+ virtual ~JoinableThread() {}
void Start() {
thread_.Start();
}
void Join() {
- semaphore_->Wait();
+ semaphore_.Wait();
}
virtual void Run() = 0;
@@ -157,7 +155,7 @@ class JoinableThread {
virtual void Run() {
joinable_thread_->Run();
- joinable_thread_->semaphore_->Signal();
+ joinable_thread_->semaphore_.Signal();
}
private:
@@ -165,7 +163,7 @@ class JoinableThread {
};
const char* name_;
- i::Semaphore* semaphore_;
+ i::Semaphore semaphore_;
ThreadWithSemaphore thread_;
friend class ThreadWithSemaphore;
« no previous file with comments | « test/cctest/test-lock.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698