aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/unit_tester
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2010-03-24 18:51:52 +0100
committerTobias Brunner <tobias@strongswan.org>2010-03-24 18:51:52 +0100
commitdc9ddba6e3f2da0648a9c706350dbf7272e4cb78 (patch)
tree9b764f23c3d887ef6a1741eeb3901510845bd588 /src/libcharon/plugins/unit_tester
parent48aa81a67ae435462259284437d81eee353b4cd2 (diff)
downloadstrongswan-dc9ddba6e3f2da0648a9c706350dbf7272e4cb78.tar.bz2
strongswan-dc9ddba6e3f2da0648a9c706350dbf7272e4cb78.tar.xz
Adapted test_pool to the libstrongswan threading.
Diffstat (limited to 'src/libcharon/plugins/unit_tester')
-rw-r--r--src/libcharon/plugins/unit_tester/tests/test_pool.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libcharon/plugins/unit_tester/tests/test_pool.c b/src/libcharon/plugins/unit_tester/tests/test_pool.c
index 109c06fda..69a9e534f 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 <time.h>
-#include <pthread.h>
#include <library.h>
+#include <threading/thread.h>
#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;
}