Commit 8ffbce5f authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

Stop profiler thread before heap tear down

Bug: v8:8042
Change-Id: If667f1aba335d8e296052ff94e99900d446c3b29
Reviewed-on: https://chromium-review.googlesource.com/1172772Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55115}
parent adac1c2a
......@@ -2637,6 +2637,7 @@ void Isolate::Deinit() {
if (sampler && sampler->IsActive()) sampler->Stop();
FreeThreadResources();
logger_->StopProfilerThread();
// We start with the heap tear down so that releasing managed objects does
// not cause a GC.
......
......@@ -2016,17 +2016,20 @@ sampler::Sampler* Logger::sampler() {
return ticker_;
}
FILE* Logger::TearDown() {
if (!is_initialized_) return nullptr;
is_initialized_ = false;
// Stop the profiler before closing the file.
void Logger::StopProfilerThread() {
if (profiler_ != nullptr) {
profiler_->Disengage();
delete profiler_;
profiler_ = nullptr;
}
}
FILE* Logger::TearDown() {
if (!is_initialized_) return nullptr;
is_initialized_ = false;
// Stop the profiler thread before closing the file.
StopProfilerThread();
delete ticker_;
ticker_ = nullptr;
......
......@@ -144,6 +144,8 @@ class Logger : public CodeEventListener {
sampler::Sampler* sampler();
void StopProfilerThread();
// Frees resources acquired in SetUp.
// When a temporary file is used for the log, returns its stream descriptor,
// leaving the file open.
......
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