Commit e2de31c
committed
Dispatch run(ex) task through target executor
run_awaitable_ex::await_suspend was resuming the child task via
direct symmetric transfer, bypassing the target executor. This
meant the first instructions of the task body ran inline on the
caller's thread rather than on the executor's thread. For strands,
this violated the serialization invariant from the very first
instruction.
Route the initial resumption through ex_.dispatch(h) so the
executor decides where the task starts. Add a strand-based test
that verifies running_in_this_thread() is true at the first
instruction of the child task.1 parent 55efc7f commit e2de31c
2 files changed
+34
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
468 | 472 | | |
469 | 473 | | |
470 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
471 | 503 | | |
472 | 504 | | |
473 | 505 | | |
| |||
490 | 522 | | |
491 | 523 | | |
492 | 524 | | |
| 525 | + | |
493 | 526 | | |
494 | 527 | | |
495 | 528 | | |
| |||
0 commit comments