Skip to content

Commit 99fb37f

Browse files
authored
[Concurrency] Fix too optimistic TaskGroup bail-out-when-empty, (#63016)
* [Concurrency] Fix too optimistic bail-out-when-empty, discarding group may need to emit an error out of such waitAll attempt, if a previous error was already stored. * [Concurrency] DiscardingTG error thrown from body always wins * Offering body error must be done while holding lock * Must not modify waitingTask context outside lock * wip on trying to fix by changing the offer * fix bug in resuming tasks in offer/resume task in discarding group * Fix #63147 waitForAll impl in ThrowingTaskGroup, used to not wait enough rdar://104507347 * done * debug * explicitly declare virtual destructors * detach child task after filling result; dont mutate context outside of lock * Add pending count overflow protection to TaskGroup * unlock async_taskgroup_void_neverConsumingTasks again rdar://104332560 * missing include on windows for error reporting * fix ARM_ARCH_7K workaround snippet
1 parent f85430f commit 99fb37f

File tree

6 files changed

+682
-531
lines changed

6 files changed

+682
-531
lines changed

stdlib/public/Concurrency/DiscardingTaskGroup.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public func withDiscardingTaskGroup<GroupResult>(
8686
let result = await body(&group)
8787

8888
try! await group.awaitAllRemainingTasks() // try!-safe, cannot throw since this is a non throwing group
89+
8990
return result
9091
#else
9192
fatalError("Swift compiler is incompatible with this SDK version")

0 commit comments

Comments
 (0)