!1928 native daemon减少多线程使用共享指针

Merge pull request !1928 from zhangyixin/master
This commit is contained in:
openharmony_ci 2024-09-27 10:04:39 +00:00 committed by Gitee
commit c5a5dcc039
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 1 deletions

View File

@ -49,6 +49,7 @@ void StackDataRepeater::Close()
{
std::unique_lock<std::mutex> lock(mutex_);
rawDataQueue_.clear();
rawDataCacheQueue_.clear();
closed_ = true;
}
PROFILER_LOG_INFO(LOG_CORE, "StackDataRepeater Close, reducedStackCount_ : %" PRIx64 " ", reducedStackCount_);

View File

@ -505,8 +505,13 @@ void StackPreprocess::TakeResults()
unwindTimes.load(), timeCost.load(), timeCost.load() / unwindTimes.load());
}
#endif
dataRepeater_->ReturnRawStack(rawData);
} // for
for (unsigned int i = 0; i < MAX_BATCH_CNT; i++) {
if (!batchRawStack[i]) {
break;
}
dataRepeater_->ReturnRawStack(std::move(batchRawStack[i]));
}
if (hookConfig_.save_file() && hookConfig_.file_name() != "" && !isHookStandaloneSerialize_) {
continue;
}