aboutsummaryrefslogtreecommitdiff
path: root/src/coro.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coro.c')
-rw-r--r--src/coro.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/coro.c b/src/coro.c
index 82ef4f4..af0a359 100644
--- a/src/coro.c
+++ b/src/coro.c
@@ -1,11 +1,20 @@
#include <u.h>
// -----------------------------------------------------------------------
-// Assembly routines.
+// Assembly routines
extern void _newcoro(coro *co, uintptr (*func)(coro*, uintptr), void *stk);
extern uintptr _coroyield(coro *co, uintptr arg);
+// -----------------------------------------------------------------------
+// Globals
+
+// static thread_local coro *CONTEXT;
+
+// -----------------------------------------------------------------------
+// C interface
+
+/* Co-routine context */
struct coro
{
void* sp;
@@ -17,9 +26,7 @@ struct coro
coro*
coro·new(uintptr stk, uintptr (*func)(coro*, uintptr))
{
- if (!func)
- return nil;
-
+ if (!func) return nil;
if (stk == 0) stk = 8192;
byte *block = malloc(stk);