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 <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-10-11 10:47:40 +09:00
parent 872c3bcea4
commit 4499daf88e
+4 -4
View File
@@ -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;