1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-14 14:27:13 +00:00

Add a "new_channel" for root fibers.

When new fibers are scheduled on the event loop, this new_channel
receives the newly created fibers. This lets a fiber track which fibers
have been added and let's a user implement a supervisor.

Fix formatting.
This commit is contained in:
Calvin Rose
2021-01-09 18:33:40 -06:00
parent 11067d7a56
commit 475775cc9d
5 changed files with 36 additions and 22 deletions

View File

@@ -842,7 +842,8 @@ struct JanetFiber {
#ifdef JANET_EV
JanetListenerState *waiting;
uint32_t sched_id; /* Increment everytime fiber is scheduled by event loop */
void *supervisor_channel; /* Channel to push self to when signaling. */
void *done_channel; /* Channel to push self to when complete */
void *new_channel; /* Channel to push spawned children */
#endif
};