Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: runtime/vm/profiler_linux.cc

Issue 86793002: Ensure profiler manager thread has shutdown before main thread (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/profiler_android.cc ('k') | runtime/vm/profiler_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_linux.cc
diff --git a/runtime/vm/profiler_linux.cc b/runtime/vm/profiler_linux.cc
index 711dcc785982765c08d6220d391f975194e198e5..1eb650553f7c5502ac13d9fa0c39c2b39e216ac3 100644
--- a/runtime/vm/profiler_linux.cc
+++ b/runtime/vm/profiler_linux.cc
@@ -13,6 +13,7 @@
namespace dart {
DECLARE_FLAG(bool, profile);
+DECLARE_FLAG(bool, trace_profiled_isolates);
static void CollectSample(IsolateProfilerData* profiler_data,
uintptr_t pc,
@@ -129,12 +130,30 @@ void ProfilerManager::ThreadMain(uword parameters) {
ASSERT(initialized_);
ASSERT(FLAG_profile);
SignalHandler::Install(ProfileSignalAction);
+ if (FLAG_trace_profiled_isolates) {
+ OS::Print("ProfilerManager Linux ready.\n");
+ }
+ thread_running_ = true;
+ {
+ // Signal to main thread we are ready.
+ ScopedMonitor startup_lock(start_stop_monitor_);
+ startup_lock.Notify();
+ }
ScopedMonitor lock(monitor_);
while (!shutdown_) {
int64_t current_time = OS::GetCurrentTimeMicros();
int64_t next_sample = SampleAndRescheduleIsolates(current_time);
lock.WaitMicros(next_sample);
}
+ if (FLAG_trace_profiled_isolates) {
+ OS::Print("ProfilerManager Linux exiting.\n");
+ }
+ thread_running_ = false;
+ {
+ // Signal to main thread we are exiting.
+ ScopedMonitor shutdown_lock(start_stop_monitor_);
+ shutdown_lock.Notify();
+ }
}
« no previous file with comments | « runtime/vm/profiler_android.cc ('k') | runtime/vm/profiler_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698