@@ -59,9 +59,7 @@ using TargetExecutorSignature =
59
59
/* resultBuffer=*/ void *,
60
60
/* substitutions=*/ void *,
61
61
/* witnessTables=*/ void **,
62
- /* numWitnessTables=*/ size_t ,
63
- /* resumeFunc=*/ TaskContinuationFunction *,
64
- /* callContext=*/ AsyncContext *),
62
+ /* numWitnessTables=*/ size_t ),
65
63
/* throws=*/ true >;
66
64
67
65
SWIFT_CC (swiftasync)
@@ -102,7 +100,7 @@ static void ::swift_distributed_execute_target_resume(
102
100
swift_task_dealloc (context);
103
101
// See `swift_distributed_execute_target` - `parentCtx` in this case
104
102
// is `callContext` which should be completely transparent on resume.
105
- return resumeInParent (parentCtx-> Parent , error);
103
+ return resumeInParent (parentCtx, error);
106
104
}
107
105
108
106
SWIFT_CC (swiftasync)
@@ -115,9 +113,7 @@ void ::swift_distributed_execute_target(
115
113
void *resultBuffer,
116
114
void *substitutions,
117
115
void **witnessTables,
118
- size_t numWitnessTables,
119
- TaskContinuationFunction *resumeFunc,
120
- AsyncContext *callContext) {
116
+ size_t numWitnessTables) {
121
117
auto *accessor = findDistributedAccessor (targetNameStart, targetNameLength);
122
118
if (!accessor) {
123
119
assert (false && " no distributed accessor" );
@@ -135,17 +131,7 @@ void ::swift_distributed_execute_target(
135
131
AsyncContext *calleeContext = reinterpret_cast <AsyncContext *>(
136
132
swift_task_alloc (asyncFnPtr->ExpectedContextSize ));
137
133
138
- // TODO(concurrency): Special functions like this one are currently set-up
139
- // to pass "caller" context and resume function as extra parameters due to
140
- // how they are declared in C. But this particular function behaves exactly
141
- // like a regular `async throws`, which means that we need to initialize
142
- // intermediate `callContext` using parent `callerContext`. A better fix for
143
- // this situation would be to adjust IRGen and handle function like this
144
- // like regular `async` functions even though they are classified as special.
145
- callContext->Parent = callerContext;
146
- callContext->ResumeParent = resumeFunc;
147
-
148
- calleeContext->Parent = callContext;
134
+ calleeContext->Parent = callerContext;
149
135
calleeContext->ResumeParent = reinterpret_cast <TaskContinuationFunction *>(
150
136
swift_distributed_execute_target_resume);
151
137
0 commit comments