swift
d01abcb4 - Unlock BEFORE resuming the waitAll waiting task, to avoid unlock() on

Commit
2 years ago
Unlock BEFORE resuming the waitAll waiting task, to avoid unlock() on released memory. Because the waitAll() group method is called before the group returns from withTaskGroup and is used to ensure all tasks have completed before we destroy the task group, this method is then immediately followed by calling TaskGroup::destroy. If we, as previously, first resume the waiting task and then attempt to unlock the lock held by the group, we are in an unsafe situation with racing the task group destroy() and the unlock(). Therefore, we must release the lock before we resume the waiting task.
Author
Committer
Parents
Loading