From: Tobias Brunner Date: Wed, 24 Mar 2010 17:51:52 +0000 (+0100) Subject: Adapted test_pool to the libstrongswan threading. X-Git-Tag: 4.4.0~191 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dc9ddba6e3f2da0648a9c706350dbf7272e4cb78;p=thirdparty%2Fstrongswan.git Adapted test_pool to the libstrongswan threading. --- diff --git a/src/libcharon/plugins/unit_tester/tests/test_pool.c b/src/libcharon/plugins/unit_tester/tests/test_pool.c index 109c06fda5..69a9e534f7 100644 --- a/src/libcharon/plugins/unit_tester/tests/test_pool.c +++ b/src/libcharon/plugins/unit_tester/tests/test_pool.c @@ -14,9 +14,9 @@ */ #include -#include #include +#include #define ALLOCS 1000 #define THREADS 20 @@ -69,21 +69,20 @@ static void* testing(void *thread) ******************************************************************************/ bool test_pool() { + thread_t *threads[THREADS]; uintptr_t i; - void *res; - pthread_t thread[THREADS]; for (i = 0; i < THREADS; i++) { - if (pthread_create(&thread[i], NULL, (void*)testing, (void*)i) < 0) + if (!(threads[i] = thread_create((thread_main_t)testing, (void*)i))) { return FALSE; } } for (i = 0; i < THREADS; i++) { - pthread_join(thread[i], &res); - if (res == NULL) + bool *res = threads[i]->join(threads[i]); + if (!res) { return FALSE; }