summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/afc.c24
-rw-r--r--src/afc.h12
-rw-r--r--src/installation_proxy.c46
-rw-r--r--src/installation_proxy.h16
-rw-r--r--src/mobile_image_mounter.c24
-rw-r--r--src/mobile_image_mounter.h13
-rw-r--r--src/notification_proxy.c49
-rw-r--r--src/notification_proxy.h16
-rw-r--r--src/sbservices.c24
-rw-r--r--src/sbservices.h13
11 files changed, 38 insertions, 201 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 574075e..66be29f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,7 +4,7 @@ AM_CFLAGS = $(GLOBAL_CFLAGS) $(libusbmuxd_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1
4AM_LDFLAGS = $(libgnutls_LIBS) $(libtasn1_LIBS) $(libplist_LIBS) $(libusbmuxd_LIBS) $(libgcrypt_LIBS) ${libpthread_LIBS} $(openssl_LIBS) 4AM_LDFLAGS = $(libgnutls_LIBS) $(libtasn1_LIBS) $(libplist_LIBS) $(libusbmuxd_LIBS) $(libgcrypt_LIBS) ${libpthread_LIBS} $(openssl_LIBS)
5 5
6lib_LTLIBRARIES = libimobiledevice.la 6lib_LTLIBRARIES = libimobiledevice.la
7libimobiledevice_la_LIBADD = 7libimobiledevice_la_LIBADD = $(top_srcdir)/common/libinternalcommon.la
8libimobiledevice_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBIMOBILEDEVICE_SO_VERSION) -no-undefined 8libimobiledevice_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBIMOBILEDEVICE_SO_VERSION) -no-undefined
9libimobiledevice_la_SOURCES = idevice.c idevice.h \ 9libimobiledevice_la_SOURCES = idevice.c idevice.h \
10 debug.c debug.h\ 10 debug.c debug.h\
diff --git a/src/afc.c b/src/afc.c
index c281e2c..f39562d 100644
--- a/src/afc.c
+++ b/src/afc.c
@@ -43,11 +43,7 @@ static const int MAXIMUM_PACKET_SIZE = (2 << 15);
43static void afc_lock(afc_client_t client) 43static void afc_lock(afc_client_t client)
44{ 44{
45 debug_info("Locked"); 45 debug_info("Locked");
46#ifdef WIN32 46 mutex_lock(&client->mutex);
47 EnterCriticalSection(&client->mutex);
48#else
49 pthread_mutex_lock(&client->mutex);
50#endif
51} 47}
52 48
53/** 49/**
@@ -58,11 +54,7 @@ static void afc_lock(afc_client_t client)
58static void afc_unlock(afc_client_t client) 54static void afc_unlock(afc_client_t client)
59{ 55{
60 debug_info("Unlocked"); 56 debug_info("Unlocked");
61#ifdef WIN32 57 mutex_unlock(&client->mutex);
62 LeaveCriticalSection(&client->mutex);
63#else
64 pthread_mutex_unlock(&client->mutex);
65#endif
66} 58}
67 59
68/** 60/**
@@ -99,11 +91,7 @@ afc_error_t afc_client_new_with_service_client(service_client_t service_client,
99 memcpy(client_loc->afc_packet->magic, AFC_MAGIC, AFC_MAGIC_LEN); 91 memcpy(client_loc->afc_packet->magic, AFC_MAGIC, AFC_MAGIC_LEN);
100 client_loc->file_handle = 0; 92 client_loc->file_handle = 0;
101 client_loc->lock = 0; 93 client_loc->lock = 0;
102#ifdef WIN32 94 mutex_init(&client_loc->mutex);
103 InitializeCriticalSection(&client_loc->mutex);
104#else
105 pthread_mutex_init(&client_loc->mutex, NULL);
106#endif
107 95
108 *client = client_loc; 96 *client = client_loc;
109 return AFC_E_SUCCESS; 97 return AFC_E_SUCCESS;
@@ -156,11 +144,7 @@ afc_error_t afc_client_free(afc_client_t client)
156 client->parent = NULL; 144 client->parent = NULL;
157 } 145 }
158 free(client->afc_packet); 146 free(client->afc_packet);
159#ifdef WIN32 147 mutex_destroy(&client->mutex);
160 DeleteCriticalSection(&client->mutex);
161#else
162 pthread_mutex_destroy(&client->mutex);
163#endif
164 free(client); 148 free(client);
165 return AFC_E_SUCCESS; 149 return AFC_E_SUCCESS;
166} 150}
diff --git a/src/afc.h b/src/afc.h
index 33662f2..ae122e2 100644
--- a/src/afc.h
+++ b/src/afc.h
@@ -23,15 +23,11 @@
23#define __AFC_H 23#define __AFC_H
24 24
25#include <stdint.h> 25#include <stdint.h>
26#ifdef WIN32
27#include <windows.h>
28#else
29#include <pthread.h>
30#endif
31 26
32#include "libimobiledevice/afc.h" 27#include "libimobiledevice/afc.h"
33#include "service.h" 28#include "service.h"
34#include "endianness.h" 29#include "endianness.h"
30#include "common/thread.h"
35 31
36#define AFC_MAGIC "CFA6LPAA" 32#define AFC_MAGIC "CFA6LPAA"
37#define AFC_MAGIC_LEN (8) 33#define AFC_MAGIC_LEN (8)
@@ -62,11 +58,7 @@ struct afc_client_private {
62 AFCPacket *afc_packet; 58 AFCPacket *afc_packet;
63 int file_handle; 59 int file_handle;
64 int lock; 60 int lock;
65#ifdef WIN32 61 mutex_t mutex;
66 CRITICAL_SECTION mutex;
67#else
68 pthread_mutex_t mutex;
69#endif
70 int free_parent; 62 int free_parent;
71}; 63};
72 64
diff --git a/src/installation_proxy.c b/src/installation_proxy.c
index f8da91c..c49014d 100644
--- a/src/installation_proxy.c
+++ b/src/installation_proxy.c
@@ -43,11 +43,7 @@ struct instproxy_status_data {
43static void instproxy_lock(instproxy_client_t client) 43static void instproxy_lock(instproxy_client_t client)
44{ 44{
45 debug_info("InstallationProxy: Locked"); 45 debug_info("InstallationProxy: Locked");
46#ifdef WIN32 46 mutex_lock(&client->mutex);
47 EnterCriticalSection(&client->mutex);
48#else
49 pthread_mutex_lock(&client->mutex);
50#endif
51} 47}
52 48
53/** 49/**
@@ -58,11 +54,7 @@ static void instproxy_lock(instproxy_client_t client)
58static void instproxy_unlock(instproxy_client_t client) 54static void instproxy_unlock(instproxy_client_t client)
59{ 55{
60 debug_info("InstallationProxy: Unlocked"); 56 debug_info("InstallationProxy: Unlocked");
61#ifdef WIN32 57 mutex_unlock(&client->mutex);
62 LeaveCriticalSection(&client->mutex);
63#else
64 pthread_mutex_unlock(&client->mutex);
65#endif
66} 58}
67 59
68/** 60/**
@@ -112,13 +104,8 @@ instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descr
112 104
113 instproxy_client_t client_loc = (instproxy_client_t) malloc(sizeof(struct instproxy_client_private)); 105 instproxy_client_t client_loc = (instproxy_client_t) malloc(sizeof(struct instproxy_client_private));
114 client_loc->parent = plistclient; 106 client_loc->parent = plistclient;
115#ifdef WIN32 107 mutex_init(&client_loc->mutex);
116 InitializeCriticalSection(&client_loc->mutex);
117 client_loc->status_updater = NULL; 108 client_loc->status_updater = NULL;
118#else
119 pthread_mutex_init(&client_loc->mutex, NULL);
120 client_loc->status_updater = (pthread_t)NULL;
121#endif
122 109
123 *client = client_loc; 110 *client = client_loc;
124 return INSTPROXY_E_SUCCESS; 111 return INSTPROXY_E_SUCCESS;
@@ -142,17 +129,9 @@ instproxy_error_t instproxy_client_free(instproxy_client_t client)
142 client->parent = NULL; 129 client->parent = NULL;
143 if (client->status_updater) { 130 if (client->status_updater) {
144 debug_info("joining status_updater"); 131 debug_info("joining status_updater");
145#ifdef WIN32 132 thread_join(client->status_updater);
146 WaitForSingleObject(client->status_updater, INFINITE);
147#else
148 pthread_join(client->status_updater, NULL);
149#endif
150 } 133 }
151#ifdef WIN32 134 mutex_destroy(&client->mutex);
152 DeleteCriticalSection(&client->mutex);
153#else
154 pthread_mutex_destroy(&client->mutex);
155#endif
156 free(client); 135 free(client);
157 136
158 return INSTPROXY_E_SUCCESS; 137 return INSTPROXY_E_SUCCESS;
@@ -375,11 +354,7 @@ static void* instproxy_status_updater(void* arg)
375 if (data->operation) { 354 if (data->operation) {
376 free(data->operation); 355 free(data->operation);
377 } 356 }
378#ifdef WIN32
379 data->client->status_updater = NULL; 357 data->client->status_updater = NULL;
380#else
381 data->client->status_updater = (pthread_t)NULL;
382#endif
383 instproxy_unlock(data->client); 358 instproxy_unlock(data->client);
384 free(data); 359 free(data);
385 360
@@ -414,18 +389,9 @@ static instproxy_error_t instproxy_create_status_updater(instproxy_client_t clie
414 data->operation = strdup(operation); 389 data->operation = strdup(operation);
415 data->user_data = user_data; 390 data->user_data = user_data;
416 391
417#ifdef WIN32 392 if (thread_create(&client->status_updater, instproxy_status_updater, data) == 0) {
418 client->status_updater = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)instproxy_status_updater, data, 0, NULL);
419 if (client->status_updater != INVALID_HANDLE_VALUE) {
420 res = INSTPROXY_E_SUCCESS;
421 } else {
422 client->status_updater = NULL;
423 }
424#else
425 if (pthread_create(&client->status_updater, NULL, instproxy_status_updater, data) == 0) {
426 res = INSTPROXY_E_SUCCESS; 393 res = INSTPROXY_E_SUCCESS;
427 } 394 }
428#endif
429 } 395 }
430 } else { 396 } else {
431 /* sync mode */ 397 /* sync mode */
diff --git a/src/installation_proxy.h b/src/installation_proxy.h
index 40175a0..4f79c12 100644
--- a/src/installation_proxy.h
+++ b/src/installation_proxy.h
@@ -22,24 +22,14 @@
22#ifndef __INSTALLATION_PROXY_H 22#ifndef __INSTALLATION_PROXY_H
23#define __INSTALLATION_PROXY_H 23#define __INSTALLATION_PROXY_H
24 24
25#ifdef WIN32
26#include <windows.h>
27#else
28#include <pthread.h>
29#endif
30
31#include "libimobiledevice/installation_proxy.h" 25#include "libimobiledevice/installation_proxy.h"
32#include "property_list_service.h" 26#include "property_list_service.h"
27#include "common/thread.h"
33 28
34struct instproxy_client_private { 29struct instproxy_client_private {
35 property_list_service_client_t parent; 30 property_list_service_client_t parent;
36#ifdef WIN32 31 mutex_t mutex;
37 CRITICAL_SECTION mutex; 32 thread_t status_updater;
38 HANDLE status_updater;
39#else
40 pthread_mutex_t mutex;
41 pthread_t status_updater;
42#endif
43}; 33};
44 34
45#endif 35#endif
diff --git a/src/mobile_image_mounter.c b/src/mobile_image_mounter.c
index 1d608db..209e367 100644
--- a/src/mobile_image_mounter.c
+++ b/src/mobile_image_mounter.c
@@ -35,11 +35,7 @@
35 */ 35 */
36static void mobile_image_mounter_lock(mobile_image_mounter_client_t client) 36static void mobile_image_mounter_lock(mobile_image_mounter_client_t client)
37{ 37{
38#ifdef WIN32 38 mutex_lock(&client->mutex);
39 EnterCriticalSection(&client->mutex);
40#else
41 pthread_mutex_lock(&client->mutex);
42#endif
43} 39}
44 40
45/** 41/**
@@ -49,11 +45,7 @@ static void mobile_image_mounter_lock(mobile_image_mounter_client_t client)
49 */ 45 */
50static void mobile_image_mounter_unlock(mobile_image_mounter_client_t client) 46static void mobile_image_mounter_unlock(mobile_image_mounter_client_t client)
51{ 47{
52#ifdef WIN32 48 mutex_unlock(&client->mutex);
53 LeaveCriticalSection(&client->mutex);
54#else
55 pthread_mutex_unlock(&client->mutex);
56#endif
57} 49}
58 50
59/** 51/**
@@ -107,11 +99,7 @@ mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, lockdown
107 mobile_image_mounter_client_t client_loc = (mobile_image_mounter_client_t) malloc(sizeof(struct mobile_image_mounter_client_private)); 99 mobile_image_mounter_client_t client_loc = (mobile_image_mounter_client_t) malloc(sizeof(struct mobile_image_mounter_client_private));
108 client_loc->parent = plistclient; 100 client_loc->parent = plistclient;
109 101
110#ifdef WIN32 102 mutex_init(&client_loc->mutex);
111 InitializeCriticalSection(&client_loc->mutex);
112#else
113 pthread_mutex_init(&client_loc->mutex, NULL);
114#endif
115 103
116 *client = client_loc; 104 *client = client_loc;
117 return MOBILE_IMAGE_MOUNTER_E_SUCCESS; 105 return MOBILE_IMAGE_MOUNTER_E_SUCCESS;
@@ -133,11 +121,7 @@ mobile_image_mounter_error_t mobile_image_mounter_free(mobile_image_mounter_clie
133 121
134 property_list_service_client_free(client->parent); 122 property_list_service_client_free(client->parent);
135 client->parent = NULL; 123 client->parent = NULL;
136#ifdef WIN32 124 mutex_destroy(&client->mutex);
137 DeleteCriticalSection(&client->mutex);
138#else
139 pthread_mutex_destroy(&client->mutex);
140#endif
141 free(client); 125 free(client);
142 126
143 return MOBILE_IMAGE_MOUNTER_E_SUCCESS; 127 return MOBILE_IMAGE_MOUNTER_E_SUCCESS;
diff --git a/src/mobile_image_mounter.h b/src/mobile_image_mounter.h
index 4056dc8..67cb589 100644
--- a/src/mobile_image_mounter.h
+++ b/src/mobile_image_mounter.h
@@ -22,22 +22,13 @@
22#ifndef __MOBILE_IMAGE_MOUNTER_H 22#ifndef __MOBILE_IMAGE_MOUNTER_H
23#define __MOBILE_IMAGE_MOUNTER_H 23#define __MOBILE_IMAGE_MOUNTER_H
24 24
25#ifdef WIN32
26#include <windows.h>
27#else
28#include <pthread.h>
29#endif
30
31#include "libimobiledevice/mobile_image_mounter.h" 25#include "libimobiledevice/mobile_image_mounter.h"
32#include "property_list_service.h" 26#include "property_list_service.h"
27#include "common/thread.h"
33 28
34struct mobile_image_mounter_client_private { 29struct mobile_image_mounter_client_private {
35 property_list_service_client_t parent; 30 property_list_service_client_t parent;
36#ifdef WIN32 31 mutex_t mutex;
37 CRITICAL_SECTION mutex;
38#else
39 pthread_mutex_t mutex;
40#endif
41}; 32};
42 33
43#endif 34#endif
diff --git a/src/notification_proxy.c b/src/notification_proxy.c
index 5b293f8..952e5f2 100644
--- a/src/notification_proxy.c
+++ b/src/notification_proxy.c
@@ -46,11 +46,7 @@ struct np_thread {
46static void np_lock(np_client_t client) 46static void np_lock(np_client_t client)
47{ 47{
48 debug_info("NP: Locked"); 48 debug_info("NP: Locked");
49#ifdef WIN32 49 mutex_lock(&client->mutex);
50 EnterCriticalSection(&client->mutex);
51#else
52 pthread_mutex_lock(&client->mutex);
53#endif
54} 50}
55 51
56/** 52/**
@@ -61,11 +57,7 @@ static void np_lock(np_client_t client)
61static void np_unlock(np_client_t client) 57static void np_unlock(np_client_t client)
62{ 58{
63 debug_info("NP: Unlocked"); 59 debug_info("NP: Unlocked");
64#ifdef WIN32 60 mutex_unlock(&client->mutex);
65 LeaveCriticalSection(&client->mutex);
66#else
67 pthread_mutex_unlock(&client->mutex);
68#endif
69} 61}
70 62
71/** 63/**
@@ -117,13 +109,8 @@ np_error_t np_client_new(idevice_t device, lockdownd_service_descriptor_t servic
117 np_client_t client_loc = (np_client_t) malloc(sizeof(struct np_client_private)); 109 np_client_t client_loc = (np_client_t) malloc(sizeof(struct np_client_private));
118 client_loc->parent = plistclient; 110 client_loc->parent = plistclient;
119 111
120#ifdef WIN32 112 mutex_init(&client_loc->mutex);
121 InitializeCriticalSection(&client_loc->mutex);
122 client_loc->notifier = NULL; 113 client_loc->notifier = NULL;
123#else
124 pthread_mutex_init(&client_loc->mutex, NULL);
125 client_loc->notifier = (pthread_t)NULL;
126#endif
127 114
128 *client = client_loc; 115 *client = client_loc;
129 return NP_E_SUCCESS; 116 return NP_E_SUCCESS;
@@ -146,17 +133,9 @@ np_error_t np_client_free(np_client_t client)
146 client->parent = NULL; 133 client->parent = NULL;
147 if (client->notifier) { 134 if (client->notifier) {
148 debug_info("joining np callback"); 135 debug_info("joining np callback");
149#ifdef WIN32 136 thread_join(client->notifier);
150 WaitForSingleObject(client->notifier, INFINITE);
151#else
152 pthread_join(client->notifier, NULL);
153#endif
154 } 137 }
155#ifdef WIN32 138 mutex_destroy(&client->mutex);
156 DeleteCriticalSection(&client->mutex);
157#else
158 pthread_mutex_destroy(&client->mutex);
159#endif
160 free(client); 139 free(client);
161 140
162 return NP_E_SUCCESS; 141 return NP_E_SUCCESS;
@@ -415,13 +394,8 @@ np_error_t np_set_notify_callback( np_client_t client, np_notify_cb_t notify_cb,
415 debug_info("callback already set, removing\n"); 394 debug_info("callback already set, removing\n");
416 property_list_service_client_t parent = client->parent; 395 property_list_service_client_t parent = client->parent;
417 client->parent = NULL; 396 client->parent = NULL;
418#ifdef WIN32 397 thread_join(client->notifier);
419 WaitForSingleObject(client->notifier, INFINITE);
420 client->notifier = NULL; 398 client->notifier = NULL;
421#else
422 pthread_join(client->notifier, NULL);
423 client->notifier = (pthread_t)NULL;
424#endif
425 client->parent = parent; 399 client->parent = parent;
426 } 400 }
427 401
@@ -432,18 +406,9 @@ np_error_t np_set_notify_callback( np_client_t client, np_notify_cb_t notify_cb,
432 npt->cbfunc = notify_cb; 406 npt->cbfunc = notify_cb;
433 npt->user_data = user_data; 407 npt->user_data = user_data;
434 408
435#ifdef WIN32 409 if (thread_create(&client->notifier, np_notifier, npt) == 0) {
436 client->notifier = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)np_notifier, npt, 0, NULL);
437 if (client->notifier != INVALID_HANDLE_VALUE) {
438 res = NP_E_SUCCESS;
439 } else {
440 client->notifier = NULL;
441 }
442#else
443 if (pthread_create(&client->notifier, NULL, np_notifier, npt) == 0) {
444 res = NP_E_SUCCESS; 410 res = NP_E_SUCCESS;
445 } 411 }
446#endif
447 } 412 }
448 } else { 413 } else {
449 debug_info("no callback set"); 414 debug_info("no callback set");
diff --git a/src/notification_proxy.h b/src/notification_proxy.h
index d8e9915..c2ded6a 100644
--- a/src/notification_proxy.h
+++ b/src/notification_proxy.h
@@ -22,24 +22,14 @@
22#ifndef __NOTIFICATION_PROXY_H 22#ifndef __NOTIFICATION_PROXY_H
23#define __NOTIFICATION_PROXY_H 23#define __NOTIFICATION_PROXY_H
24 24
25#ifdef WIN32
26#include <windows.h>
27#else
28#include <pthread.h>
29#endif
30
31#include "libimobiledevice/notification_proxy.h" 25#include "libimobiledevice/notification_proxy.h"
32#include "property_list_service.h" 26#include "property_list_service.h"
27#include "common/thread.h"
33 28
34struct np_client_private { 29struct np_client_private {
35 property_list_service_client_t parent; 30 property_list_service_client_t parent;
36#ifdef WIN32 31 mutex_t mutex;
37 CRITICAL_SECTION mutex; 32 thread_t notifier;
38 HANDLE notifier;
39#else
40 pthread_mutex_t mutex;
41 pthread_t notifier;
42#endif
43}; 33};
44 34
45void* np_notifier(void* arg); 35void* np_notifier(void* arg);
diff --git a/src/sbservices.c b/src/sbservices.c
index 00f2862..1cd17db 100644
--- a/src/sbservices.c
+++ b/src/sbservices.c
@@ -36,11 +36,7 @@
36static void sbs_lock(sbservices_client_t client) 36static void sbs_lock(sbservices_client_t client)
37{ 37{
38 debug_info("SBServices: Locked"); 38 debug_info("SBServices: Locked");
39#ifdef WIN32 39 mutex_lock(&client->mutex);
40 EnterCriticalSection(&client->mutex);
41#else
42 pthread_mutex_lock(&client->mutex);
43#endif
44} 40}
45 41
46/** 42/**
@@ -51,11 +47,7 @@ static void sbs_lock(sbservices_client_t client)
51static void sbs_unlock(sbservices_client_t client) 47static void sbs_unlock(sbservices_client_t client)
52{ 48{
53 debug_info("SBServices: Unlocked"); 49 debug_info("SBServices: Unlocked");
54#ifdef WIN32 50 mutex_unlock(&client->mutex);
55 LeaveCriticalSection(&client->mutex);
56#else
57 pthread_mutex_unlock(&client->mutex);
58#endif
59} 51}
60 52
61/** 53/**
@@ -105,11 +97,7 @@ sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_des
105 97
106 sbservices_client_t client_loc = (sbservices_client_t) malloc(sizeof(struct sbservices_client_private)); 98 sbservices_client_t client_loc = (sbservices_client_t) malloc(sizeof(struct sbservices_client_private));
107 client_loc->parent = plistclient; 99 client_loc->parent = plistclient;
108#ifdef WIN32 100 mutex_init(&client_loc->mutex);
109 InitializeCriticalSection(&client_loc->mutex);
110#else
111 pthread_mutex_init(&client_loc->mutex, NULL);
112#endif
113 101
114 *client = client_loc; 102 *client = client_loc;
115 return SBSERVICES_E_SUCCESS; 103 return SBSERVICES_E_SUCCESS;
@@ -131,11 +119,7 @@ sbservices_error_t sbservices_client_free(sbservices_client_t client)
131 119
132 sbservices_error_t err = sbservices_error(property_list_service_client_free(client->parent)); 120 sbservices_error_t err = sbservices_error(property_list_service_client_free(client->parent));
133 client->parent = NULL; 121 client->parent = NULL;
134#ifdef WIN32 122 mutex_destroy(&client->mutex);
135 DeleteCriticalSection(&client->mutex);
136#else
137 pthread_mutex_destroy(&client->mutex);
138#endif
139 free(client); 123 free(client);
140 124
141 return err; 125 return err;
diff --git a/src/sbservices.h b/src/sbservices.h
index 598b794..ba64d67 100644
--- a/src/sbservices.h
+++ b/src/sbservices.h
@@ -22,22 +22,13 @@
22#ifndef __SBSERVICES_H 22#ifndef __SBSERVICES_H
23#define __SBSERVICES_H 23#define __SBSERVICES_H
24 24
25#ifdef WIN32
26#include <windows.h>
27#else
28#include <pthread.h>
29#endif
30
31#include "libimobiledevice/sbservices.h" 25#include "libimobiledevice/sbservices.h"
32#include "property_list_service.h" 26#include "property_list_service.h"
27#include "common/thread.h"
33 28
34struct sbservices_client_private { 29struct sbservices_client_private {
35 property_list_service_client_t parent; 30 property_list_service_client_t parent;
36#ifdef WIN32 31 mutex_t mutex;
37 CRITICAL_SECTION mutex;
38#else
39 pthread_mutex_t mutex;
40#endif
41}; 32};
42 33
43#endif 34#endif