Revision: 16330
Author:   [email protected]
Date:     Mon Aug 26 14:52:26 2013 UTC
Log:      Make sure semaphore used in Profiler is deleted

BUG=None
[email protected]

Review URL: https://codereview.chromium.org/23420004
http://code.google.com/p/v8/source/detail?r=16330

Modified:
 /branches/bleeding_edge/src/log.cc

=======================================
--- /branches/bleeding_edge/src/log.cc  Fri Aug 23 17:20:54 2013 UTC
+++ /branches/bleeding_edge/src/log.cc  Mon Aug 26 14:52:26 2013 UTC
@@ -560,6 +560,14 @@
     }
   }

+  virtual void Run();
+
+  // Pause and Resume TickSample data collection.
+  bool paused() const { return paused_; }
+  void pause() { paused_ = true; }
+  void resume() { paused_ = false; }
+
+ private:
   // Waits for a signal and removes profiling data.
   bool Remove(TickSample* sample) {
     buffer_semaphore_->Wait();  // Wait for an element.
@@ -570,14 +578,6 @@
     return result;
   }

-  void Run();
-
-  // Pause and Resume TickSample data collection.
-  bool paused() const { return paused_; }
-  void pause() { paused_ = true; }
-  void resume() { paused_ = false; }
-
- private:
   // Returns the next index in the cyclic buffer.
   int Succ(int index) { return (index + 1) % kBufferSize; }

@@ -589,7 +589,8 @@
   int head_;  // Index to the buffer head.
   int tail_;  // Index to the buffer tail.
   bool overflow_;  // Tell whether a buffer overflow has occurred.
- Semaphore* buffer_semaphore_; // Sempahore used for buffer synchronization.
+  // Sempahore used for buffer synchronization.
+  SmartPointer<Semaphore> buffer_semaphore_;

// Tells whether profiler is engaged, that is, processing thread is stated.
   bool engaged_;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to