@@ -523,23 +523,35 @@ void swift_defaultActor_destroy(DefaultActor *actor);
523
523
SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
524
524
void swift_defaultActor_enqueue (Job *job, DefaultActor *actor);
525
525
526
- // / Resume a task from its continuation, given a normal result value.
526
+ // / Prepare a continuation in the current task.
527
+ // /
528
+ // / The caller should initialize the Parent, ResumeParent,
529
+ // / and NormalResult fields. This function will initialize the other
530
+ // / fields with appropriate defaaults; the caller may then overwrite
531
+ // / them if desired.
532
+ // /
533
+ // / This function is provided as a code-size and runtime-usage
534
+ // / optimization; calling it is not required if code is willing to
535
+ // / do all its work inline.
536
+ SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
537
+ AsyncTask *swift_continuation_init (ContinuationAsyncContext *context,
538
+ AsyncContinuationFlags flags);
539
+
540
+ // / Resume a task from a non-throwing continuation, given a normal
541
+ // / result which has already been stored into the continuation.
527
542
SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
528
- void swift_continuation_resume (/* +1 */ OpaqueValue *result,
529
- void *continuation,
530
- const Metadata *resumeType);
543
+ void swift_continuation_resume (AsyncTask *continuation);
531
544
532
- // / Resume a task from its throwing continuation, given a normal result value.
545
+ // / Resume a task from a potentially-throwing continuation, given a
546
+ // / normal result which has already been stored into the continuation.
533
547
SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
534
- void swift_continuation_throwingResume (/* +1 */ OpaqueValue *result,
535
- void *continuation,
536
- const Metadata *resumeType);
548
+ void swift_continuation_throwingResume (AsyncTask *continuation);
537
549
538
- // / Resume a task from its throwing continuation by throwing an error.
550
+ // / Resume a task from a potentially-throwing continuation by throwing
551
+ // / an error.
539
552
SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
540
- void swift_continuation_throwingResumeWithError (/* +1 */ SwiftError *error,
541
- void *continuation,
542
- const Metadata *resumeType);
553
+ void swift_continuation_throwingResumeWithError (AsyncTask *continuation,
554
+ /* +1 */ SwiftError *error);
543
555
544
556
// / SPI helper to log a misuse of a `CheckedContinuation` to the appropriate places in the OS.
545
557
extern " C" SWIFT_CC(swift)
0 commit comments