Driveby pendantry: The "running_" variable would now be better named "may_run_" since it's true even before the event processor is running.
/L On Wed, Aug 18, 2010 at 17:33, Anton Muhin <ant...@chromium.org> wrote: > LGTM and thanks. > > yours, > anton. > > On Wed, Aug 18, 2010 at 7:28 PM, <mnaga...@chromium.org> wrote: > > Reviewers: antonm, > > > > Description: > > 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 > > > > Please review this at http://codereview.chromium.org/3157022/show > > > > Affected files: > > M src/cpu-profiler.cc > > > > > > Index: src/cpu-profiler.cc > > diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc > > index > > > 3e554ccebdc9faa9190313feb7374e78312ffb1f..c0ed9297a2dd966a5daf9a5b7046e2ac2601c04a > > 100644 > > --- a/src/cpu-profiler.cc > > +++ b/src/cpu-profiler.cc > > @@ -46,7 +46,7 @@ static const int kTickSamplesBufferChunksCount = 16; > > > > ProfilerEventsProcessor::ProfilerEventsProcessor(ProfileGenerator* > > generator) > > : generator_(generator), > > - running_(false), > > + running_(true), > > ticks_buffer_(sizeof(TickSampleEventRecord), > > kTickSamplesBufferChunkSize, > > kTickSamplesBufferChunksCount), > > @@ -247,7 +247,6 @@ bool ProfilerEventsProcessor::ProcessTicks(unsigned > > dequeue_order) { > > > > void ProfilerEventsProcessor::Run() { > > unsigned dequeue_order = 0; > > - running_ = true; > > > > while (running_) { > > // Process ticks until we have any. > > > > > > > > -- > v8-dev mailing list > v8-dev@googlegroups.com > http://groups.google.com/group/v8-dev > -- Lasse R.H. Nielsen l...@google.com 'Faith without judgement merely degrades the spirit divine' Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 København K - Denmark - CVR nr. 28 86 69 84 -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev