Commit f4f9db6
committed
Fix MSVC thread_pool join test failure (49 of 50 tasks)
The run_async trampoline coroutine used suspend_never for
final_suspend, relying on automatic frame destruction when
the coroutine falls through. MSVC's symmetric transfer
implementation (which uses an internal trampoline loop
rather than true tail calls) can mishandle this pattern,
potentially double-destroying the frame. When the work_guard
destructor fires twice, outstanding_work_ reaches zero one
task early, stop_ is set, and the remaining queued task is
abandoned without its handler running.
Replace suspend_never with an explicit destroyer awaiter that
calls h.destroy() in await_suspend and returns void. This
gives MSVC's symmetric transfer loop a clean exit point and
avoids the problematic auto-destruction codepath. Both
trampoline specializations (allocator-based and
memory_resource*) are updated.1 parent 55efc7f commit f4f9db6
1 file changed
Lines changed: 36 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
160 | 176 | | |
161 | 177 | | |
162 | 178 | | |
| |||
245 | 261 | | |
246 | 262 | | |
247 | 263 | | |
248 | | - | |
| 264 | + | |
249 | 265 | | |
250 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
251 | 283 | | |
252 | 284 | | |
253 | 285 | | |
| |||
0 commit comments