mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
0ea429e29e
when sleep is called from root context (not within a task), it was instantly advancing the simulated tick counter instead of actually delaying. this caused task_pass.rb example to run tasks 0-5 instantly without proper delays between iterations. fixed by using clock_gettime() to track elapsed real time and sleeping in 1ms intervals. also clear switching_ flag when returning from root context sleep to prevent unwanted context switches. removed find_earliest_wakeup_tick() function and time-advancing logic from task_run_one_iteration() as real delays are now handled by sleep itself. Co-authored-by: Claude <noreply@anthropic.com>