mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
f58051c48e
This commit fixes several critical issues in the task scheduler: 1. Context switching now properly saves and restores ci/cci pointers and sets prev links, following the fiber implementation pattern. This prevents crashes when tasks complete. 2. Sleep implementation now falls back to blocking sleep (usleep/Sleep) when not in task context, fixing standalone sleep calls. 3. Removed unused functions q_find_task and task_free to eliminate compiler warnings. 4. Added platform-specific headers for sleep functions on Unix/Windows. 5. Enabled HAL initialization which was previously commented out. 6. Added SA_RESTART flag to SIGALRM handler to prevent timer from interrupting IO syscalls, fixing mrbtest IO.popen failures. Co-authored-by: Claude <noreply@anthropic.com>