Skip to content

Commit eeda39a

Browse files
authored
RemoteInspection: Add AsyncTaskInfo.IsSuspended based on HasTaskDependency (#82965)
Adds an `IsSuspended` field to `AsyncTaskInfo`, which is the same value as `HasTaskDependency`, but uses the `Is<State>` naming to match `IsEnqueued`, `IsRunning`, and `IsComplete`. Based on the docs in Task.h: ```cpp /// A task can have the following states: /// * suspended: In this state, a task is considered not runnable /// * enqueued: In this state, a task is considered runnable /// * running on a thread /// * completed ``` rdar://148663671
1 parent 648722e commit eeda39a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/swift/RemoteInspection/ReflectionContext.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ class ReflectionContext
197197
bool IsRunning;
198198
bool IsEnqueued;
199199
bool IsComplete;
200+
bool IsSuspended;
200201

201202
bool HasThreadPort;
202203
uint32_t ThreadPort;
@@ -1784,6 +1785,8 @@ class ReflectionContext
17841785
Info.IsEscalated = TaskStatusFlags & ActiveTaskStatusFlags::IsEscalated;
17851786
Info.IsEnqueued = TaskStatusFlags & ActiveTaskStatusFlags::IsEnqueued;
17861787
Info.IsComplete = TaskStatusFlags & ActiveTaskStatusFlags::IsComplete;
1788+
Info.IsSuspended =
1789+
TaskStatusFlags & ActiveTaskStatusFlags::HasTaskDependency;
17871790

17881791
setIsRunning(Info, AsyncTaskObj.get());
17891792
std::tie(Info.HasThreadPort, Info.ThreadPort) =

include/swift/RemoteInspection/RuntimeInternals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ struct ActiveTaskStatusFlags {
113113
static const uint32_t IsRunning = 0x800;
114114
static const uint32_t IsEnqueued = 0x1000;
115115
static const uint32_t IsComplete = 0x2000;
116+
static const uint32_t HasTaskDependency = 0x4000;
116117
};
117118

118119
template <typename Runtime, typename ActiveTaskStatus>

0 commit comments

Comments
 (0)