Skip to content

Commit 4483ac8

Browse files
committed
[Concurrency] implement withCancellationHandler via records
1 parent 485a894 commit 4483ac8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/Runtime/Concurrency.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct AsyncTaskAndContext {
3838
/// be true, and this must be called synchronously with the parent.
3939
/// The parent is responsible for creating a ChildTaskStatusRecord.
4040
/// TODO: should we have a single runtime function for creating a task
41-
/// and doing this child task status record management?
41+
/// and doing this child task status record management?
4242
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
4343
AsyncTaskAndContext swift_task_create(JobFlags flags,
4444
AsyncTask *parent,
@@ -66,7 +66,7 @@ using FutureAsyncSignature =
6666
/// be true, and this must be called synchronously with the parent.
6767
/// The parent is responsible for creating a ChildTaskStatusRecord.
6868
/// TODO: should we have a single runtime function for creating a task
69-
/// and doing this child task status record management?
69+
/// and doing this child task status record management?
7070
///
7171
/// flags.task_isFuture must be set. \c futureResultType is the type
7272
///

test/Concurrency/Runtime/async_taskgroup_cancel_parent_affects_group.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func test_taskGroup_cancel_parent_affects_group() async {
2727
let x = Task.runDetached {
2828
try! await Task.withGroup(resultType: Int.self) { group -> Void in
2929
await group.add {
30-
sleep(3)
30+
usleep(3 * 1000)
3131
let c = await Task.__unsafeCurrentAsync().isCancelled
3232
print("group task isCancelled: \(c)")
3333
return 0

0 commit comments

Comments
 (0)