Commit d01abcb
committed
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.1 parent b814a51 commit d01abcb
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1810 | 1810 | | |
1811 | 1811 | | |
1812 | 1812 | | |
1813 | | - | |
1814 | | - | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
1815 | 1816 | | |
| 1817 | + | |
| 1818 | + | |
1816 | 1819 | | |
1817 | 1820 | | |
1818 | 1821 | | |
| |||
0 commit comments