Fix race in CpuProfiler::StopProcessor / CpuProfiler::TickSampleEvent.
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 26 Sep 2011 16:31:11 +0000 (16:31 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 26 Sep 2011 16:31:11 +0000 (16:31 +0000)
R=mstarzinger@chromium.org
BUG=v8:1700
TEST=inspector/profiler/cpu-profiler-profiling-without-inspector.html

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9433 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/cpu-profiler.cc

index 65490285e75fa87f01a337d43bcd4189059e3a40..d74c034ac53a0a68b74feef3b09e00398fa019a6 100644 (file)
@@ -551,12 +551,12 @@ void CpuProfiler::StopProcessor() {
     sampler->Stop();
     need_to_stop_sampler_ = false;
   }
+  NoBarrier_Store(&is_profiling_, false);
   processor_->Stop();
   processor_->Join();
   delete processor_;
   delete generator_;
   processor_ = NULL;
-  NoBarrier_Store(&is_profiling_, false);
   generator_ = NULL;
   logger->logging_nesting_ = saved_logging_nesting_;
 }