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

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: more clean-up and addressed review comments Created 4 years, 6 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
Index: base/process/process_win.cc
diff --git a/base/process/process_win.cc b/base/process/process_win.cc
index 8e508a1b1fbaa4496b8ba34cef30bb2903b8cda7..50182745bc660ab0664c1bc10ab2a770e2426f8d 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 diagonsis).
manzagop (departed) 2016/06/16 15:19:40 typo!
+ 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)

Powered by Google App Engine
This is Rietveld 408576698