Chromium Code Reviews

Unified Diff: src/optimizing-compiler-thread.h

Issue 23748003: Cleanup Semaphore class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Damn broken Rietveld! Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/optimizing-compiler-thread.h
diff --git a/src/optimizing-compiler-thread.h b/src/optimizing-compiler-thread.h
index 10ed420b7f5b367ddefd8593e2f07bdfd60d6e5d..bb96c7479b6bd1b5262f6b6e69a1eac291114b61 100644
--- a/src/optimizing-compiler-thread.h
+++ b/src/optimizing-compiler-thread.h
@@ -50,11 +50,12 @@ class OptimizingCompilerThread : public Thread {
thread_id_(0),
#endif
isolate_(isolate),
- stop_semaphore_(OS::CreateSemaphore(0)),
- input_queue_semaphore_(OS::CreateSemaphore(0)) {
+ stop_semaphore_(0),
+ input_queue_semaphore_(0) {
NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(CONTINUE));
NoBarrier_Store(&queue_length_, static_cast<AtomicWord>(0));
}
+ ~OptimizingCompilerThread() {}
void Run();
void Stop();
@@ -80,13 +81,6 @@ class OptimizingCompilerThread : public Thread {
bool IsOptimizerThread();
#endif
- ~OptimizingCompilerThread() {
- delete input_queue_semaphore_;
- delete stop_semaphore_;
-#ifdef DEBUG
-#endif
- }
-
private:
enum StopFlag { CONTINUE, STOP, FLUSH };
@@ -101,8 +95,8 @@ class OptimizingCompilerThread : public Thread {
#endif
Isolate* isolate_;
- Semaphore* stop_semaphore_;
- Semaphore* input_queue_semaphore_;
+ Semaphore stop_semaphore_;
+ Semaphore input_queue_semaphore_;
UnboundQueue<OptimizingCompiler*> input_queue_;
UnboundQueue<OptimizingCompiler*> output_queue_;
Mutex install_mutex_;

Powered by Google App Engine