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

Unified Diff: base/win/wait_chain.h

Issue 1834463002: Identify the hung thread using the Wait Chain Traversal API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BASE_EXPORT 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 | « base/base.gypi ('k') | base/win/wait_chain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/wait_chain.h
diff --git a/base/win/wait_chain.h b/base/win/wait_chain.h
new file mode 100644
index 0000000000000000000000000000000000000000..4cd73553332d52336de98ad5ecd408bd754baa24
--- /dev/null
+++ b/base/win/wait_chain.h
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_WIN_WAIT_CHAIN_H_
+#define BASE_WIN_WAIT_CHAIN_H_
+
+#include <windows.h>
+#include <wct.h>
+
+#include <vector>
+
+#include "base/strings/string16.h"
+
+namespace base {
+namespace win {
+
+using WaitChainNodeVector = std::vector<WAITCHAIN_NODE_INFO>;
+
+// Gets the wait chain for |thread_id|. Also specifies if the |wait_chain|
+// contains a deadlock. Returns true on success.
+//
+// From MSDN: A wait chain is an alternating sequence of threads and
+// synchronization objects; each thread waits for the object that follows it,
+// which is owned by the subsequent thread in the chain.
+BASE_EXPORT bool GetThreadWaitChain(DWORD thread_id,
+ WaitChainNodeVector* wait_chain,
+ bool* is_deadlock);
+
+// Returns a string that represents the node for a wait chain.
+BASE_EXPORT base::string16 WaitChainNodeToString(
+ const WAITCHAIN_NODE_INFO& node);
+
+} // namespace win
+} // namespace base
+
+#endif // BASE_WIN_WAIT_CHAIN_H_
« no previous file with comments | « base/base.gypi ('k') | base/win/wait_chain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698