]>
Commit | Line | Data |
---|---|---|
ffe2af3a JP |
1 | From c0b552973c5db6dbe4dd0bdc47496da3d7af9606 Mon Sep 17 00:00:00 2001 |
2 | From: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com> | |
3 | Date: Sun, 1 Aug 2021 20:44:13 -0300 | |
4 | Subject: [PATCH] ithread: Remove references to | |
5 | pthread_mutexattr_{g,s}etkind_np | |
6 | ||
7 | --- | |
8 | upnp/inc/ithread.h | 33 ++++++++++++++------------------- | |
9 | 1 file changed, 14 insertions(+), 19 deletions(-) | |
10 | ||
11 | diff --git a/upnp/inc/ithread.h b/upnp/inc/ithread.h | |
12 | index f6800ea9..2087466b 100644 | |
13 | --- a/upnp/inc/ithread.h | |
14 | +++ b/upnp/inc/ithread.h | |
15 | @@ -304,11 +304,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void) | |
16 | * Returns EINVAL if the kind is not supported. | |
17 | * See man page for pthread_mutexattr_setkind_np | |
18 | *****************************************************************************/ | |
19 | -#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__) | |
20 | - #define ithread_mutexattr_setkind_np pthread_mutexattr_settype | |
21 | -#else | |
22 | - #define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np | |
23 | -#endif /* UPNP_USE_RWLOCK */ | |
24 | +#define ithread_mutexattr_setkind_np pthread_mutexattr_settype | |
25 | +#define ithread_mutexattr_settype pthread_mutexattr_settype | |
26 | ||
27 | /**************************************************************************** | |
28 | * Function: ithread_mutexattr_getkind_np | |
29 | @@ -329,11 +326,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void) | |
30 | * Always returns 0. | |
31 | * See man page for pthread_mutexattr_getkind_np | |
32 | *****************************************************************************/ | |
33 | -#if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__) | |
34 | - #define ithread_mutexattr_getkind_np pthread_mutexattr_gettype | |
35 | -#else | |
36 | - #define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np | |
37 | -#endif /* UPNP_USE_RWLOCK */ | |
38 | +#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype | |
39 | +#define ithread_mutexattr_gettype pthread_mutexattr_gettype | |
40 | ||
41 | /**************************************************************************** | |
42 | * Function: ithread_mutex_init | |
43 | @@ -898,15 +892,16 @@ static UPNP_INLINE int ithread_cleanup_thread(void) | |
44 | #ifdef _WIN32 | |
45 | #define imillisleep Sleep | |
46 | #else | |
47 | -#if _POSIX_C_SOURCE < 200809L | |
48 | - #define imillisleep(x) usleep(1000 * x) | |
49 | -#else | |
50 | - #define imillisleep(x) \ | |
51 | - do { \ | |
52 | - const struct timespec req = {0, x * 1000 * 1000}; \ | |
53 | - nanosleep(&req, NULL); \ | |
54 | - } while(0) | |
55 | -#endif | |
56 | + #if _POSIX_C_SOURCE < 200809L | |
57 | + #define imillisleep(x) usleep(1000 * x) | |
58 | + #else | |
59 | + #define imillisleep(x) \ | |
60 | + do { \ | |
61 | + const struct timespec req = { \ | |
62 | + 0, x * 1000 * 1000}; \ | |
63 | + nanosleep(&req, NULL); \ | |
64 | + } while (0) | |
65 | + #endif | |
66 | #endif | |
67 | ||
68 | #if !defined(PTHREAD_MUTEX_RECURSIVE) && !defined(__DragonFly__) && \ |