@@ -240,6 +240,7 @@ bool swift_taskGroup_isCancelled(TaskGroup *group);
240240SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
241241bool swift_taskGroup_isEmpty (TaskGroup *group);
242242
243+ // / DEPRECATED. swift_asyncLet_begin is used instead.
243244// / Its Swift signature is
244245// /
245246// / \code
@@ -255,12 +256,31 @@ void swift_asyncLet_start(AsyncLet *alet,
255256 const Metadata *futureResultType,
256257 void *closureEntryPoint, HeapObject *closureContext);
257258
259+ // / Begin an async let child task.
260+ // / Its Swift signature is
261+ // /
262+ // / \code
263+ // / func swift_asyncLet_start<T>(
264+ // / asyncLet: Builtin.RawPointer,
265+ // / options: Builtin.RawPointer?,
266+ // / operation: __owned @Sendable () async throws -> T,
267+ // / resultBuffer: Builtin.RawPointer
268+ // / )
269+ // / \endcode
270+ SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
271+ void swift_asyncLet_begin (AsyncLet *alet,
272+ TaskOptionRecord *options,
273+ const Metadata *futureResultType,
274+ void *closureEntryPoint, HeapObject *closureContext,
275+ void *resultBuffer);
276+
258277// / This matches the ABI of a closure `<T>(Builtin.RawPointer) async -> T`
259278using AsyncLetWaitSignature =
260279 SWIFT_CC (swiftasync)
261280 void (OpaqueValue *,
262281 SWIFT_ASYNC_CONTEXT AsyncContext *, AsyncTask *, Metadata *);
263282
283+ // / DEPRECATED. swift_asyncLet_get is used instead.
264284// / Wait for a non-throwing async-let to complete.
265285// /
266286// / This can be called from any thread. Its Swift signature is
@@ -276,6 +296,7 @@ void swift_asyncLet_wait(OpaqueValue *,
276296 AsyncLet *, TaskContinuationFunction *,
277297 AsyncContext *);
278298
299+ // / DEPRECATED. swift_asyncLet_get_throwing is used instead.
279300// / Wait for a potentially-throwing async-let to complete.
280301// /
281302// / This can be called from any thread. Its Swift signature is
@@ -292,6 +313,7 @@ void swift_asyncLet_wait_throwing(OpaqueValue *,
292313 ThrowingTaskFutureWaitContinuationFunction *,
293314 AsyncContext *);
294315
316+ // / DEPRECATED. swift_asyncLet_finish is used instead.
295317// / Its Swift signature is
296318// /
297319// / \code
@@ -300,6 +322,121 @@ void swift_asyncLet_wait_throwing(OpaqueValue *,
300322SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
301323void swift_asyncLet_end (AsyncLet *alet);
302324
325+ // / Get the value of a non-throwing async-let, awaiting the result if necessary.
326+ // /
327+ // / This can be called from any thread. Its Swift signature is
328+ // /
329+ // / \code
330+ // / func swift_asyncLet_get(
331+ // / _ asyncLet: Builtin.RawPointer,
332+ // / _ resultBuffer: Builtin.RawPointer
333+ // / ) async
334+ // / \endcode
335+ // /
336+ // / \c result points at the variable storage for the binding. It is
337+ // / uninitialized until the first call to \c swift_asyncLet_get or
338+ // / \c swift_asyncLet_get_throwing. That first call initializes the storage
339+ // / with the result of the child task. Subsequent calls do nothing and leave
340+ // / the value in place.
341+ SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swiftasync)
342+ void swift_asyncLet_get (SWIFT_ASYNC_CONTEXT AsyncContext *,
343+ AsyncLet *,
344+ void *,
345+ TaskContinuationFunction *,
346+ AsyncContext *);
347+
348+ // / Get the value of a throwing async-let, awaiting the result if necessary.
349+ // /
350+ // / This can be called from any thread. Its Swift signature is
351+ // /
352+ // / \code
353+ // / func swift_asyncLet_get_throwing(
354+ // / _ asyncLet: Builtin.RawPointer,
355+ // / _ resultBuffer: Builtin.RawPointer
356+ // / ) async throws
357+ // / \endcode
358+ // /
359+ // / \c result points at the variable storage for the binding. It is
360+ // / uninitialized until the first call to \c swift_asyncLet_get or
361+ // / \c swift_asyncLet_get_throwing. That first call initializes the storage
362+ // / with the result of the child task. Subsequent calls do nothing and leave
363+ // / the value in place. A pointer to the storage inside the child task is
364+ // / returned if the task completes successfully, otherwise the error from the
365+ // / child task is thrown.
366+ SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swiftasync)
367+ void swift_asyncLet_get_throwing (SWIFT_ASYNC_CONTEXT AsyncContext *,
368+ AsyncLet *,
369+ void *,
370+ ThrowingTaskFutureWaitContinuationFunction *,
371+ AsyncContext *);
372+
373+ // / Exit the scope of an async-let binding. If the task is still running, it
374+ // / is cancelled, and we await its completion; otherwise, we destroy the
375+ // / value in the variable storage.
376+ // /
377+ // / Its Swift signature is
378+ // /
379+ // / \code
380+ // / func swift_asyncLet_finish(_ asyncLet: Builtin.RawPointer,
381+ // / _ resultBuffer: Builtin.RawPointer) async
382+ // / \endcode
383+ SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swiftasync)
384+ void swift_asyncLet_finish (SWIFT_ASYNC_CONTEXT AsyncContext *,
385+ AsyncLet *,
386+ void *,
387+ TaskContinuationFunction *,
388+ AsyncContext *);
389+
390+ // / Get the value of a non-throwing async-let, awaiting the result if necessary,
391+ // / and then destroy the child task. The result buffer is left initialized after
392+ // / returning.
393+ // /
394+ // / This can be called from any thread. Its Swift signature is
395+ // /
396+ // / \code
397+ // / func swift_asyncLet_get(
398+ // / _ asyncLet: Builtin.RawPointer,
399+ // / _ resultBuffer: Builtin.RawPointer
400+ // / ) async
401+ // / \endcode
402+ // /
403+ // / \c result points at the variable storage for the binding. It is
404+ // / uninitialized until the first call to \c swift_asyncLet_get or
405+ // / \c swift_asyncLet_get_throwing. The child task will be invalidated after
406+ // / this call, so the `async let` can not be gotten or finished afterward.
407+ SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swiftasync)
408+ void swift_asyncLet_consume (SWIFT_ASYNC_CONTEXT AsyncContext *,
409+ AsyncLet *,
410+ void *,
411+ TaskContinuationFunction *,
412+ AsyncContext *);
413+
414+ // / Get the value of a throwing async-let, awaiting the result if necessary,
415+ // / and then destroy the child task. The result buffer is left initialized after
416+ // / returning.
417+ // /
418+ // / This can be called from any thread. Its Swift signature is
419+ // /
420+ // / \code
421+ // / func swift_asyncLet_get_throwing(
422+ // / _ asyncLet: Builtin.RawPointer,
423+ // / _ resultBuffer: Builtin.RawPointer
424+ // / ) async throws
425+ // / \endcode
426+ // /
427+ // / \c result points at the variable storage for the binding. It is
428+ // / uninitialized until the first call to \c swift_asyncLet_get or
429+ // / \c swift_asyncLet_get_throwing. That first call initializes the storage
430+ // / with the result of the child task. Subsequent calls do nothing and leave
431+ // / the value in place. The child task will be invalidated after
432+ // / this call, so the `async let` can not be gotten or finished afterward.
433+ SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swiftasync)
434+ void swift_asyncLet_consume_throwing (SWIFT_ASYNC_CONTEXT AsyncContext *,
435+ AsyncLet *,
436+ void *,
437+ ThrowingTaskFutureWaitContinuationFunction *,
438+ AsyncContext *);
439+
303440// / Returns true if the currently executing AsyncTask has a
304441// / 'TaskGroupTaskStatusRecord' present.
305442// /
0 commit comments