Fix issue 833: eliminate race condition in ProfilerEventsProcessor.

When under a load, the ProfilerEventsProcessor thread can start
(enter Run) after Stop has been called, thus resetting running_
data member back to 'true', and starting an infinite loop.

BUG=833

Review URL: http://codereview.chromium.org/3157022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5304 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2f76132a
...@@ -46,7 +46,7 @@ static const int kTickSamplesBufferChunksCount = 16; ...@@ -46,7 +46,7 @@ static const int kTickSamplesBufferChunksCount = 16;
ProfilerEventsProcessor::ProfilerEventsProcessor(ProfileGenerator* generator) ProfilerEventsProcessor::ProfilerEventsProcessor(ProfileGenerator* generator)
: generator_(generator), : generator_(generator),
running_(false), running_(true),
ticks_buffer_(sizeof(TickSampleEventRecord), ticks_buffer_(sizeof(TickSampleEventRecord),
kTickSamplesBufferChunkSize, kTickSamplesBufferChunkSize,
kTickSamplesBufferChunksCount), kTickSamplesBufferChunksCount),
...@@ -247,7 +247,6 @@ bool ProfilerEventsProcessor::ProcessTicks(unsigned dequeue_order) { ...@@ -247,7 +247,6 @@ bool ProfilerEventsProcessor::ProcessTicks(unsigned dequeue_order) {
void ProfilerEventsProcessor::Run() { void ProfilerEventsProcessor::Run() {
unsigned dequeue_order = 0; unsigned dequeue_order = 0;
running_ = true;
while (running_) { while (running_) {
// Process ticks until we have any. // Process ticks until we have any.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment