From b2924a1549d874fb86deaad5fd2438e567c65bf4 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 20 Mar 2013 05:38:06 +0100 Subject: use new internal common code for thread, mutex, and socket operations --- dev/afccheck.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'dev') diff --git a/dev/afccheck.c b/dev/afccheck.c index 665aa47..3eb53c8 100644 --- a/dev/afccheck.c +++ b/dev/afccheck.c @@ -22,11 +22,11 @@ #include #include #include -#include #include #include #include +#include "common/thread.h" #define BUFFER_SIZE 20000 #define NB_THREADS 10 @@ -85,7 +85,7 @@ static void* check_afc(void *data) //cleanup afc_remove_path(((param *) data)->afc, path); - pthread_exit(0); + return NULL; } int main(int argc, char *argv[]) @@ -125,18 +125,18 @@ int main(int argc, char *argv[]) service = NULL; } - pthread_t threads[NB_THREADS]; + thread_t threads[NB_THREADS]; param data[NB_THREADS]; int i = 0; for (i = 0; i < NB_THREADS; i++) { data[i].afc = afc; data[i].id = i + 1; - pthread_create(&threads[i], NULL, check_afc, data + i); + thread_create(&threads[i], check_afc, data + i); } for (i = 0; i < NB_THREADS; i++) { - pthread_join(threads[i], NULL); + thread_join(threads[i]); } lockdownd_client_free(client); -- cgit v1.1-32-gdbae