diff options
Diffstat (limited to 'src/test-asyncq.c')
-rw-r--r-- | src/test-asyncq.c | 14 |
1 files changed, 9 insertions, 5 deletions
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 <config.h> +#endif + #include <stdlib.h> #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; } |