diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2018-12-11 14:28:32 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2018-12-11 14:28:32 -0800 |
commit | f8f72bbc97acb4189195646647f6eab01565ee33 (patch) | |
tree | f8f72c9de153db3433ce57319fce0d378e8dbfee /src/example.c | |
parent | 2f62a1a750b98976e841f10c9e2254ac0ae6f646 (diff) |
example: add arity-0 fiber
I really should add a comprehensive set of unit tests...
Diffstat (limited to 'src/example.c')
-rw-r--r-- | src/example.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 <stdio.h> #include <thunk.h> +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++) |