Commit bf056db
Remove check_preempt() from impl_facade!: Nio/Iocp layers handle cooperative yielding
Per maintainer feedback: cooperative preemption should NOT be in the
impl_facade! macro layer. The Nio/Iocp syscall layers already call
Suspender::suspend_with themselves (e.g., NioSleepSyscall yields via
EventLoops::wait_event).
Changes:
- Remove check_preempt() call from impl_facade! in syscall/windows/mod.rs
- Remove pub(crate) fn check_preempt() from monitor.rs
- Keep PREEMPT_PENDING two-level safety in do_preempt() to prevent
crashing when SuspendThread fires during critical sections (heap
allocation, IO). First SuspendThread sets flag and returns; second
SuspendThread forces suspension for truly CPU-bound loops.
- Update comments to reflect correct architecture
Agent-Logs-Url: https://github.com/acl-dev/open-coroutine/sessions/838614fd-23df-4980-ae2a-837b1fe07788
Co-authored-by: loongs-zhang <38336731+loongs-zhang@users.noreply.github.com>1 parent d1cccd5 commit bf056db
2 files changed
Lines changed: 13 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
507 | | - | |
508 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
509 | 511 | | |
510 | 512 | | |
511 | 513 | | |
512 | 514 | | |
513 | 515 | | |
514 | 516 | | |
515 | 517 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | 518 | | |
533 | 519 | | |
534 | 520 | | |
535 | 521 | | |
536 | 522 | | |
537 | | - | |
| 523 | + | |
538 | 524 | | |
539 | 525 | | |
540 | 526 | | |
| |||
543 | 529 | | |
544 | 530 | | |
545 | 531 | | |
546 | | - | |
547 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
548 | 535 | | |
549 | 536 | | |
550 | 537 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 98 | | |
104 | 99 | | |
105 | 100 | | |
| |||
0 commit comments