mirror of
https://github.com/janet-lang/janet
synced 2025-10-19 17:57:40 +00:00
Working TCP echo server and client.
Required a few changes to APIs, namely janet_root_fiber() to get topmost fiber that is active in the current scheduler. This is distinct from janet_current_fiber(), which gets the bottom most fiber in the fiber stack - it might have a parent, and so cannot be reliably resumed. This is the kind of situation that makes symmetric coroutines more attractive.
This commit is contained in:
@@ -43,6 +43,7 @@ extern JANET_THREAD_LOCAL int janet_vm_stackn;
|
||||
/* The current running fiber on the current thread.
|
||||
* Set and unset by janet_run. */
|
||||
extern JANET_THREAD_LOCAL JanetFiber *janet_vm_fiber;
|
||||
extern JANET_THREAD_LOCAL JanetFiber *janet_vm_root_fiber;
|
||||
|
||||
/* The current pointer to the inner most jmp_buf. The current
|
||||
* return point for panics. */
|
||||
|
Reference in New Issue
Block a user