summaryrefslogtreecommitdiffstats
path: root/dev
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-03-20 05:38:06 +0100
committerGravatar Nikias Bassen2013-03-20 05:38:06 +0100
commitb2924a1549d874fb86deaad5fd2438e567c65bf4 (patch)
treeead89f885a0492cdfc228a1c25326912e7d9b973 /dev
parentefca491e4c19868a68a099638552f9ba431dca4b (diff)
downloadlibimobiledevice-b2924a1549d874fb86deaad5fd2438e567c65bf4.tar.gz
libimobiledevice-b2924a1549d874fb86deaad5fd2438e567c65bf4.tar.bz2
use new internal common code for thread, mutex, and socket operations
Diffstat (limited to 'dev')
-rw-r--r--dev/afccheck.c10
1 files changed, 5 insertions, 5 deletions
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 <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <pthread.h>
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
#include <libimobiledevice/afc.h>
+#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);