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

Unified Diff: base/process/process_win.cc

Issue 1980743002: Track thread activities in order to diagnose hangs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@readwrite-mmf
Patch Set: rebased Created 4 years, 4 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 | « base/process/process_posix.cc ('k') | base/synchronization/lock_impl_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_win.cc
diff --git a/base/process/process_win.cc b/base/process/process_win.cc
index 8e508a1b1fbaa4496b8ba34cef30bb2903b8cda7..6629f4565a74fb5e019ad05e845feba09f65625e 100644
--- a/base/process/process_win.cc
+++ b/base/process/process_win.cc
@@ -4,6 +4,7 @@
#include "base/process/process.h"
+#include "base/debug/activity_tracker.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/process/kill.h"
@@ -142,6 +143,9 @@ bool Process::WaitForExit(int* exit_code) {
}
bool Process::WaitForExitWithTimeout(TimeDelta timeout, int* exit_code) {
+ // Record the event that this thread is blocking upon (for hang diagnosis).
+ base::debug::ScopedProcessWaitActivity process_activity(this);
+
// Limit timeout to INFINITE.
DWORD timeout_ms = saturated_cast<DWORD>(timeout.InMilliseconds());
if (::WaitForSingleObject(Handle(), timeout_ms) != WAIT_OBJECT_0)
« no previous file with comments | « base/process/process_posix.cc ('k') | base/synchronization/lock_impl_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698