From 18301dfca56ba8545549e80f84423d83a46c6b64 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 2 Oct 2007 20:26:08 +0000 Subject: a lot of minor cleanups git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@36 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce --- src/test-asyncq.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/test-asyncq.c') diff --git a/src/test-asyncq.c b/src/test-asyncq.c index 26dbc55..e32c5c9 100644 --- a/src/test-asyncq.c +++ b/src/test-asyncq.c @@ -1,3 +1,7 @@ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include "asyncq.h" @@ -9,7 +13,7 @@ static void thread(void *userdata) { sa_asyncq_t *q = userdata; int i; - + for (i = 0; i < ITERATIONS_MAX; i++) { sa_asyncq_item_t *i; @@ -30,12 +34,12 @@ int main(int argc, char *argv[]) { sa_asyncq_item_t *i; sa_assert_success(sa_asyncq_init(&q)); - + t = sa_thread_new(thread, &q); sa_assert(t); for (j = 0; j < ITERATIONS_MAX; j++) { - + do { i = sa_asyncq_pop(&q, 0); printf("%s ", i ? "gotcha" : "miss"); @@ -49,14 +53,14 @@ int main(int argc, char *argv[]) { } printf("\n"); - + sa_thread_free(t); while (sa_asyncq_pop(&q, 1)) ; sa_asyncq_done(&q); - + return 0; } -- cgit