swift
fb4eb519 - [6.1][Concurrency] Fix a race when using cancelAll on a task group concurrently with child tasks being removed.

Commit
228 days ago
[6.1][Concurrency] Fix a race when using cancelAll on a task group concurrently with child tasks being removed. _swift_taskGroup_cancelAllChildren relies on there being no concurrent modification when called from the owning task, but this is not guaranteed. Rearrange things to always take the owning task's status record lock when walking the group's children. Split _swift_taskGroup_cancelAllChildren into two functions, one which assumes/requires the lock is already held, and one which acquires the lock. We don't have the owning task in this case, but we can either get it from the current task, or by looking at the parent of the child task we're working on. rdar://147172991 (cherry picked from commit 38c4fce1a814122774eb7e099fbf8be3a36a63e1)
Author
Committer
Parents
Loading