mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
47dfb771cf
this patch fixes several critical issues in the task scheduler: 1. vm integration for computed goto dispatch mode: - added task switching check in NEXT macro for computed goto - previous implementation only worked with switch dispatch mode - now Task.pass properly yields control to other tasks 2. task lifecycle tracking: - added 'started' flag to mrb_task structure - fixed first-run detection to avoid popping callinfo multiple times - vm overwrites context status during execution, making it unreliable 3. removed mrblib/task.rb: - empty Ruby method stubs were overriding C implementations - all task methods now properly implemented in C 4. cleaned up task scheduler loop: - proper task completion detection using switching flag - round-robin scheduling for tasks at same priority - clean scheduler exit when all tasks complete tasks now cooperatively yield with Task.pass and complete cleanly. Co-authored-by: Claude <noreply@anthropic.com>