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

Unified Diff: runtime/vm/safepoint.cc

Issue 1886583002: Add a temporary timeout and print in the safepoint waiter to log if we are stuck waiting for a thre… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/safepoint.cc
diff --git a/runtime/vm/safepoint.cc b/runtime/vm/safepoint.cc
index fcf287237624be98a06bd1ea554f0a8a504c340c..6cbd0f7840f3a2b0272fe75adee75d3060c47ea3 100644
--- a/runtime/vm/safepoint.cc
+++ b/runtime/vm/safepoint.cc
@@ -96,8 +96,15 @@ void SafepointHandler::SafepointThreads(Thread* T) {
// Now wait for all threads that are not already at a safepoint to check-in.
{
MonitorLocker sl(safepoint_lock_);
+ intptr_t num_attempts = 0;
while (number_threads_not_at_safepoint_ > 0) {
- sl.Wait();
+ Monitor::WaitResult retval = sl.Wait(1000);
+ if (retval == Monitor::kTimedOut) {
+ num_attempts += 1;
+ OS::Print("Attempt:%" Pd " waiting for %d threads to check in\n",
+ num_attempts,
+ number_threads_not_at_safepoint_);
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698