@@ -240,6 +240,7 @@ bool swift_taskGroup_isCancelled(TaskGroup *group);
240
240
SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
241
241
bool swift_taskGroup_isEmpty (TaskGroup *group);
242
242
243
+ // / DEPRECATED. swift_asyncLet_begin is used instead.
243
244
// / Its Swift signature is
244
245
// /
245
246
// / \code
@@ -255,12 +256,31 @@ void swift_asyncLet_start(AsyncLet *alet,
255
256
const Metadata *futureResultType,
256
257
void *closureEntryPoint, HeapObject *closureContext);
257
258
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
+
258
277
// / This matches the ABI of a closure `<T>(Builtin.RawPointer) async -> T`
259
278
using AsyncLetWaitSignature =
260
279
SWIFT_CC (swiftasync)
261
280
void (OpaqueValue *,
262
281
SWIFT_ASYNC_CONTEXT AsyncContext *, AsyncTask *, Metadata *);
263
282
283
+ // / DEPRECATED. swift_asyncLet_get is used instead.
264
284
// / Wait for a non-throwing async-let to complete.
265
285
// /
266
286
// / This can be called from any thread. Its Swift signature is
@@ -276,6 +296,7 @@ void swift_asyncLet_wait(OpaqueValue *,
276
296
AsyncLet *, TaskContinuationFunction *,
277
297
AsyncContext *);
278
298
299
+ // / DEPRECATED. swift_asyncLet_get_throwing is used instead.
279
300
// / Wait for a potentially-throwing async-let to complete.
280
301
// /
281
302
// / This can be called from any thread. Its Swift signature is
@@ -292,6 +313,7 @@ void swift_asyncLet_wait_throwing(OpaqueValue *,
292
313
ThrowingTaskFutureWaitContinuationFunction *,
293
314
AsyncContext *);
294
315
316
+ // / DEPRECATED. swift_asyncLet_finish is used instead.
295
317
// / Its Swift signature is
296
318
// /
297
319
// / \code
@@ -300,6 +322,134 @@ void swift_asyncLet_wait_throwing(OpaqueValue *,
300
322
SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
301
323
void swift_asyncLet_end (AsyncLet *alet);
302
324
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
+
440
+ // / Returns true if the currently executing AsyncTask has a
441
+ // / 'TaskGroupTaskStatusRecord' present.
442
+ // /
443
+ // / This can be called from any thread.
444
+ // /
445
+ // / Its Swift signature is
446
+ // /
447
+ // / \code
448
+ // / func swift_taskGroup_hasTaskGroupRecord()
449
+ // / \endcode
450
+ SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(swift)
451
+ bool swift_taskGroup_hasTaskGroupRecord ();
452
+
303
453
// / Add a status record to a task. The record should not be
304
454
// / modified while it is registered with a task.
305
455
// /
0 commit comments