Chromium Code Reviews| 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..49d920584e220f891d8d83c2ddcb64d9de46bd90 |
| --- /dev/null |
| +++ b/base/win/wait_chain.h |
| @@ -0,0 +1,34 @@ |
| +// 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> |
| + |
| +namespace base { |
| +namespace win { |
| + |
| +using WaitChain = std::vector<WAITCHAIN_NODE_INFO>; |
|
grt (UTC plus 2)
2016/04/12 14:31:12
consider WaitChainNodeInfoVector or WaitChainNodeV
Patrick Monette
2016/04/12 19:13:00
Done.
|
| + |
| +// Get the wait chain for the |thread_id|. Also specifies if the |wait_chain| |
|
grt (UTC plus 2)
2016/04/12 14:31:12
nit: "Gets the wait chain for |thread_id|."
Patrick Monette
2016/04/12 19:13:00
Done.
|
| +// 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. |
| +bool GetThreadWaitChain(DWORD thread_id, |
| + WaitChain* wait_chain, |
| + bool* is_deadlock); |
| + |
| +// Returns a string that represents the node for a wait chain. |
| +std::wstring WaitChainNodeToString(const WAITCHAIN_NODE_INFO& node); |
| + |
| +} // namespace win |
| +} // namespace base |
| + |
| +#endif // BASE_WIN_WAIT_CHAIN_H_ |