From 4499daf88e49b33afd083b3ef0e266fb45b6e6e1 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 11 Oct 2025 10:47:40 +0900 Subject: [PATCH] mruby.h: simplify task state definitions using fiber state aliases remove MRB_TASK_CREATED and MRB_TASK_STOPPED from mrb_fiber_state enum and define them as aliases to MRB_FIBER_CREATED and MRB_FIBER_TERMINATED. this makes the relationship between tasks and fibers clearer and avoids artificially extending the enum with semantically equivalent values. Co-authored-by: Claude --- include/mruby.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mruby.h b/include/mruby.h index 0531a08b0..76aa962da 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -187,12 +187,12 @@ enum mrb_fiber_state { MRB_FIBER_SUSPENDED, MRB_FIBER_TRANSFERRED, MRB_FIBER_TERMINATED, -#ifdef MRB_USE_TASK_SCHEDULER - MRB_TASK_CREATED, - MRB_TASK_STOPPED, -#endif }; +/* Task context status aliases */ +#define MRB_TASK_CREATED MRB_FIBER_CREATED +#define MRB_TASK_STOPPED MRB_FIBER_TERMINATED + struct mrb_context { struct mrb_context *prev;