summaryrefslogtreecommitdiffstats
path: root/test/httpget.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2010-03-10 13:58:39 +0200
committerTimo Teras <timo.teras@iki.fi>2010-03-10 13:58:39 +0200
commit5ef38570315dc68d7ddf8d9475d9a8830528e8a4 (patch)
treef88fc542b5231614ac6c22a75baea90d82449d6c /test/httpget.c
parent43e69b26126b8708b70680c6b4806eb3844386ab (diff)
downloadlibtf-5ef38570315dc68d7ddf8d9475d9a8830528e8a4.tar.bz2
libtf-5ef38570315dc68d7ddf8d9475d9a8830528e8a4.tar.xz
libtf: separate scheduler fibre, change the core api
Diffstat (limited to 'test/httpget.c')
-rw-r--r--test/httpget.c16
1 files changed, 6 insertions, 10 deletions
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();
}