mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Initial Task Executor implementation Task(on:), addTask(on:) etc. (#68793)
Co-authored-by: John McCall <rjmccall@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7a3e3aea15
commit
828f589be4
@@ -208,6 +208,12 @@ class TaskExecutorRef {
|
||||
|
||||
public:
|
||||
|
||||
// Only public for CompatibilityOverrideConcurrency stubs.
|
||||
// Prefer `TaskExecutorRef::undefined` instead.
|
||||
explicit TaskExecutorRef() : Identity(nullptr), Implementation(0) {
|
||||
assert(isUndefined());
|
||||
}
|
||||
|
||||
constexpr static TaskExecutorRef undefined() {
|
||||
return TaskExecutorRef(nullptr, 0);
|
||||
}
|
||||
@@ -232,6 +238,8 @@ public:
|
||||
return Identity == 0;
|
||||
}
|
||||
|
||||
bool isDefined() const { return !isUndefined(); }
|
||||
|
||||
TaskExecutorKind getExecutorKind() const {
|
||||
return static_cast<TaskExecutorKind>(Implementation & ~WitnessTableMask);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user