1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-04 09:33:02 +00:00

Allow iterating over fibers with each and similar.

This commit is contained in:
Calvin Rose
2021-01-03 16:17:36 -06:00
parent ecc6eb7497
commit c357af02c2
9 changed files with 146 additions and 7 deletions

View File

@@ -838,6 +838,7 @@ struct JanetFiber {
JanetTable *env; /* Dynamic bindings table (usually current environment). */
Janet *data; /* Dynamically resized stack memory */
JanetFiber *child; /* Keep linked list of fibers for restarting pending fibers */
Janet last_value; /* Last returned value from a fiber */
#ifdef JANET_EV
JanetListenerState *waiting;
uint32_t sched_id; /* Increment everytime fiber is scheduled by event loop */