diff options
Diffstat (limited to 'test/simple1.c')
-rw-r--r-- | test/simple1.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/test/simple1.c b/test/simple1.c index 65a787c..6a05b7a 100644 --- a/test/simple1.c +++ b/test/simple1.c @@ -10,23 +10,20 @@ static void work_fiber(void *ptr) struct ctx *c = (struct ctx*) ptr; printf("Hello%d.1\n", c->id); - tf_yield(); + tf_fiber_yield(); printf("Hello%d.2\n", c->id); } -static void init_fiber(void *ptr) +int main(int argc, char **argv) { struct ctx *c; int i; + tf_scheduler_enable(NULL); for (i = 0; i < 6; i++) { - c = tf_fiber_create(work_fiber, sizeof(struct ctx)); + c = tf_fiber_create(NULL, work_fiber, sizeof(struct ctx)); c->id = i; tf_fiber_put(c); } -} - -int main(int argc, char **argv) -{ - return tf_main(init_fiber); + tf_scheduler_disable(); } |