Commit 7c3b06d
committed
[Concurrency] Avoid de-escalating a task when racing to escalate.
Reload oldPriority each time through the compare_exchange loop. Without this, we might race with another escalating thread and end up trying to set a priority that's lower or equal to the priority set by the other thread. This results in an assertion failure when asserts are enabled, or attempt to lower the priority of the task when asserts are not enabled.
rdar://1478887681 parent 97b249b commit 7c3b06d
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1142 | 1145 | | |
1143 | 1146 | | |
1144 | 1147 | | |
| |||
0 commit comments