From f8f72bbc97acb4189195646647f6eab01565ee33 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 11 Dec 2018 14:28:32 -0800 Subject: example: add arity-0 fiber I really should add a comprehensive set of unit tests... --- src/example.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/example.c b/src/example.c index 8c1d3cb..c3e729d 100644 --- a/src/example.c +++ b/src/example.c @@ -17,6 +17,13 @@ #include #include +THUNK_DEFINE(nil) +{ + puts("no args"); + + return 0; +} + THUNK_DEFINE(bye, pulp_t *, p) { @@ -38,6 +45,8 @@ THUNK_DEFINE(bar, int, id) THUNK_DEFINE(foo, pulp_t *, p, int, w, int, h) { + (void) pulp_fiber_new(p, 0, THUNK(nil())); + for (int y = 0; y < h; y++) { printf("\nw=%i h=%i\n", w, h); for (int x = 0; x < w; x++) -- cgit v1.2.3