From 5ef38570315dc68d7ddf8d9475d9a8830528e8a4 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Wed, 10 Mar 2010 13:58:39 +0200 Subject: libtf: separate scheduler fibre, change the core api --- test/httpget.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'test/httpget.c') diff --git a/test/httpget.c b/test/httpget.c index fed6c06..9aec886 100644 --- a/test/httpget.c +++ b/test/httpget.c @@ -44,20 +44,16 @@ err: ctx->hostname, bytes, -r, strerror(-r)); } -static void init_fiber(void *ptr) +int main(int argc, char **argv) { - struct tf_main_ctx *ctx = (struct tf_main_ctx *) ptr; struct ctx *c; int i; - for (i = 1; i < ctx->argc; i++) { - c = tf_fiber_create(ping_fiber, sizeof(struct ctx)); - c->hostname = ctx->argv[i]; + tf_scheduler_enable(NULL); + for (i = 1; i < argc; i++) { + c = tf_fiber_create(NULL, ping_fiber, sizeof(struct ctx)); + c->hostname = argv[i]; tf_fiber_put(c); } -} - -int main(int argc, char **argv) -{ - return tf_main_args(init_fiber, argc, argv); + tf_scheduler_disable(); } -- cgit v1.2.3