/src/CMake/Source/cmDebuggerThreadManager.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include <atomic> |
8 | | #include <cstdint> |
9 | | #include <list> |
10 | | #include <memory> |
11 | | #include <string> |
12 | | |
13 | | #include <cm/optional> |
14 | | |
15 | | namespace cmDebugger { |
16 | | class cmDebuggerThread; |
17 | | } |
18 | | |
19 | | namespace dap { |
20 | | struct StackTraceRequest; |
21 | | struct StackTraceResponse; |
22 | | } |
23 | | |
24 | | namespace cmDebugger { |
25 | | |
26 | | class cmDebuggerThreadManager |
27 | | { |
28 | | static std::atomic<std::int64_t> NextThreadId; |
29 | | std::list<std::shared_ptr<cmDebuggerThread>> Threads; |
30 | | |
31 | | public: |
32 | 0 | cmDebuggerThreadManager() = default; |
33 | | std::shared_ptr<cmDebuggerThread> StartThread(std::string const& name); |
34 | | void EndThread(std::shared_ptr<cmDebuggerThread> const& thread); |
35 | | cm::optional<dap::StackTraceResponse> GetThreadStackTraceResponse( |
36 | | dap::StackTraceRequest const& request); |
37 | | }; |
38 | | |
39 | | } // namespace cmDebugger |