Browse code

- added futex based locking, used by default on linux 2.5.70+ (to turn it off compile with make use_futex=no) - moved get_sys_ver from io_wait.c into ut.c

Andrei Pelinescu-Onciul authored on 14/05/2007 21:29:46
Showing 12 changed files
... ...
@@ -55,6 +55,8 @@
55 55
 #              added TLS_EXTRA_LIBS (andrei)
56 56
 #  2007-03-16  added LIB building options: LIB_LDFLAGS, LIB_SONAME, LIB_RPATH,
57 57
 #                INSTALL_LIB, libraries install paths (andrei)
58
+#  2007-05-14  futex support if linux 2.5.70+ and 
59
+#               use_futex=yes (default) (andrei)
58 60
 
59 61
 
60 62
 # check if already included/exported
... ...
@@ -71,7 +73,7 @@ MAIN_NAME=ser
71 71
 VERSION = 2
72 72
 PATCHLEVEL = 1
73 73
 SUBLEVEL =  0
74
-EXTRAVERSION = -dev2
74
+EXTRAVERSION = -dev3
75 75
 
76 76
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
77 77
 			$(SUBLEVEL) )
... ...
@@ -323,6 +325,8 @@ endif
323 323
 #		work on all systems inter-processes (e.g. linux)
324 324
 # -DUSE_POSIX_SEM
325 325
 #		uses posix semaphores for locking (faster than sys v)
326
+# -DUSE_FUTEX
327
+#		uses futexes for locking (linux 2.6+)
326 328
 # -DBUSY_WAIT
327 329
 #		uses busy waiting on the lock (FAST_LOCK)
328 330
 # -DADAPTIVE_WAIT
... ...
@@ -405,6 +409,7 @@ DEFS+= $(extra_defs) \
405 405
 	 -DUSE_DNS_FAILOVER \
406 406
 	 -DUSE_DST_BLACKLIST \
407 407
 	 -DDBG_QM_MALLOC \
408
+	 #-DF_MALLOC
408 409
 	 #-DDBG_F_MALLOC \
409 410
 	 #-DNO_DEBUG \
410 411
 	 #-DEXTRA_DEBUG \
... ...
@@ -550,6 +555,7 @@ endif
550 550
 
551 551
 ifeq ($(ARCH), alpha)
552 552
 	use_fast_lock=yes
553
+	DEFS+=-DNOSMP # very likely
553 554
 endif
554 555
 
555 556
 ifeq ($(use_fast_lock), yes)
... ...
@@ -1272,11 +1278,16 @@ LIB_SUFFIX:=.so
1272 1272
 
1273 1273
 #os specific stuff
1274 1274
 ifeq ($(OS), linux)
1275
+# by default use futexes if available
1276
+	use_futex= yes
1275 1277
 	DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
1276 1278
 			-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
1277 1279
 			-DHAVE_TIMEGM
1278 1280
 	ifneq ($(found_lock_method), yes)
1279
-		DEFS+= -DUSE_SYSV_SEM  # try posix sems
1281
+		#DEFS+= -DUSE_POSIX_SEM
1282
+		DEFS+=-DUSE_PTHREAD_MUTEX
1283
+		LIBS+= -lpthread
1284
+		#DEFS+= -DUSE_SYSV_SEM  # try posix sems
1280 1285
 		found_lock_method=yes
1281 1286
 	else
1282 1287
 		ifneq (,$(findstring -DUSE_POSIX_SEM, $(DEFS)))
... ...
@@ -1300,6 +1311,12 @@ ifeq ($(OS), linux)
1300 1300
 			DEFS+=-DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND
1301 1301
 		endif
1302 1302
 	endif
1303
+	# check for >= 2.5.70
1304
+	ifeq ($(shell [ $(OSREL_N) -ge 2005070 ] && echo has_futex), has_futex)
1305
+		ifeq ($(use_futex), yes)
1306
+			DEFS+=-DUSE_FUTEX
1307
+		endif
1308
+	endif
1303 1309
 	ifeq ($(NO_SELECT),)
1304 1310
 		DEFS+=-DHAVE_SELECT
1305 1311
 	endif
1306 1312
new file mode 100644
... ...
@@ -0,0 +1,124 @@
0
+/* 
1
+ * $Id$
2
+ * 
3
+ * Copyright (C) 2007 iptelorg GmbH
4
+ *
5
+ * Permission to use, copy, modify, and distribute this software for any
6
+ * purpose with or without fee is hereby granted, provided that the above
7
+ * copyright notice and this permission notice appear in all copies.
8
+ *
9
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+ */
17
+/*
18
+ * futex based lock (mutex) implementation  (linux 2.6+ only)
19
+ * based on Ulrich Drepper implementation in "Futexes Are Tricky"
20
+ * (http://people.redhat.com/drepper/futex.pdf)
21
+ *
22
+ * Implements:
23
+ *   void futex_get(futex_lock_t* lock);     - mutex lock
24
+ *   void futex_release(futex_lock_t* lock); - unlock
25
+ *   int  futex_try(futex_lock_t* lock);     - tries to get lock, returns 0
26
+ *                                              on success and !=0 on failure
27
+ *                                              (1 or 2)
28
+ *
29
+ *  Config defines:
30
+ */
31
+/* 
32
+ * History:
33
+ * --------
34
+ *  2007-05-13  created by andrei
35
+ */
36
+
37
+#ifndef _futexlock_h
38
+#define _futexlock_h
39
+
40
+
41
+#include "atomic/atomic_common.h"
42
+#include "atomic/atomic_native.h"
43
+
44
+#ifdef HAVE_ASM_INLINE_ATOMIC_OPS
45
+#define HAVE_FUTEX
46
+#include <linux/futex.h>
47
+#include <sys/syscall.h>
48
+#include <unistd.h>
49
+#include "compiler_opt.h"
50
+
51
+
52
+#define sys_futex(addr, op, val, timeout, addr2, val3) \
53
+	syscall(__NR_futex , (addr), (op), (val), (timeout), (addr2), (val3))
54
+
55
+typedef atomic_t futex_lock_t;
56
+
57
+/* the mutex has 3 states: 0 - free/unlocked and nobody waiting
58
+ *                         1 - locked and nobody waiting for it
59
+ *                         2 - locked w/ 0 or more waiting processes/threads
60
+ */
61
+
62
+inline static futex_lock_t* futex_init(futex_lock_t* lock)
63
+{
64
+	atomic_set(lock, 0);
65
+	return lock;
66
+}
67
+
68
+
69
+inline static void futex_get(futex_lock_t* lock)
70
+{
71
+	int v;
72
+	
73
+	v=atomic_cmpxchg(lock, 0, 1); /* lock if 0 */
74
+	if (likely(v==0)){  /* optimize for the uncontended case */
75
+		/* success */
76
+		membar_enter_lock();
77
+		return;
78
+	}else if (likely(v==2)){ /* if contended, optimize for the several waiters
79
+								case */
80
+		/* waiting processes/threads => add ourselves to the queue */
81
+		do{
82
+			sys_futex(&(lock)->val, FUTEX_WAIT, 2, 0, 0, 0);
83
+			v=atomic_get_and_set(lock, 2);
84
+		}while(v);
85
+	}else{
86
+		/* v==1 */
87
+		v=atomic_get_and_set(lock, 2);
88
+		while(v){
89
+			sys_futex(&(lock)->val, FUTEX_WAIT, 2, 0, 0, 0);
90
+			v=atomic_get_and_set(lock, 2);
91
+		}
92
+	}
93
+	membar_enter_lock();
94
+}
95
+
96
+
97
+inline static void futex_release(futex_lock_t* lock)
98
+{
99
+	int v;
100
+	
101
+	membar_leave_lock();
102
+	v=atomic_get_and_set(lock, 0);
103
+	if (unlikely(v==2)){ /* optimize for the uncontended case */
104
+		sys_futex(&(lock)->val, FUTEX_WAKE, 1, 0, 0, 0);
105
+	}
106
+}
107
+
108
+
109
+static inline int futex_try(futex_lock_t* lock)
110
+{
111
+	int c;
112
+	c=atomic_cmpxchg(lock, 0, 1);
113
+	if (likely(c))
114
+		membar_enter_lock();
115
+	return c;
116
+}
117
+
118
+
119
+#else /*HAVE_ASM_INLINE_ATOMIC_OPS*/
120
+#undef USE_FUTEX
121
+#endif /*HAVE_ASM_INLINE_ATOMIC_OPS*/
122
+
123
+#endif /* _futexlocks_h*/
... ...
@@ -50,9 +50,9 @@
50 50
 #include <unistd.h> /* close, ioctl */
51 51
 #endif
52 52
 
53
-#include <sys/utsname.h> /* uname() */
54 53
 #include <stdlib.h> /* strtol() */
55 54
 #include "io_wait.h"
55
+#include "ut.h" /* get_sys_ver() */
56 56
 
57 57
 
58 58
 #include "mem/mem.h"
... ...
@@ -295,41 +295,6 @@ static int init_select(io_wait_h* h)
295 295
 #endif
296 296
 
297 297
 
298
-
299
-/* return system version (major.minor.minor2) as
300
- *  (major<<16)|(minor)<<8|(minor2)
301
- * (if some of them are missing, they are set to 0)
302
- * if the parameters are not null they are set to the coresp. part 
303
- */
304
-static unsigned int get_sys_version(int* major, int* minor, int* minor2)
305
-{
306
-	struct utsname un;
307
-	int m1;
308
-	int m2;
309
-	int m3;
310
-	char* p;
311
-	
312
-	memset (&un, 0, sizeof(un));
313
-	m1=m2=m3=0;
314
-	/* get sys version */
315
-	uname(&un);
316
-	m1=strtol(un.release, &p, 10);
317
-	if (*p=='.'){
318
-		p++;
319
-		m2=strtol(p, &p, 10);
320
-		if (*p=='.'){
321
-			p++;
322
-			m3=strtol(p, &p, 10);
323
-		}
324
-	}
325
-	if (major) *major=m1;
326
-	if (minor) *minor=m2;
327
-	if (minor2) *minor2=m3;
328
-	return ((m1<<16)|(m2<<8)|(m3));
329
-}
330
-
331
-
332
-
333 298
 /*
334 299
  * returns 0 on success, and an error message on error
335 300
  */
336 301
new file mode 100644
... ...
@@ -0,0 +1,52 @@
0
+/* 
1
+ * $Id$
2
+ * 
3
+ * Copyright (C) 2007 iptelorg GmbH
4
+ *
5
+ * Permission to use, copy, modify, and distribute this software for any
6
+ * purpose with or without fee is hereby granted, provided that the above
7
+ * copyright notice and this permission notice appear in all copies.
8
+ *
9
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+ */
17
+/*
18
+ *  lock operations init
19
+ */
20
+/* 
21
+ * History:
22
+ * --------
23
+ *  2007-05-14  created by andrei
24
+ */
25
+
26
+#include "lock_ops.h"
27
+#include "ut.h"
28
+#include "dprint.h"
29
+
30
+/* returns 0 on success, -1 on error */
31
+int init_lock_ops()
32
+{
33
+#ifdef USE_FUTEX
34
+	int os_ver;
35
+	
36
+	os_ver=get_sys_version(0, 0, 0);
37
+	if (os_ver < 0x020546 ){ /* if ver < 2.5.70 */
38
+		LOG(L_CRIT, "ERROR: init_lock_ops: old kernel:"
39
+				" compiled with FUTEX support which is not present in the"
40
+				" running kernel (try  2.6+)\n");
41
+		return -1;
42
+	}
43
+#endif
44
+	return 0;
45
+}
46
+
47
+
48
+
49
+void destroy_lock_ops()
50
+{
51
+}
... ...
@@ -34,6 +34,7 @@
34 34
  *  2004-07-28  s/lock_set_t/gen_lock_set_t/ because of a type conflict
35 35
  *              on darwin (andrei)
36 36
  *  2006-04-04  added lock_try(lock) and lock_set_try(s,i) (andrei)
37
+ *  2007-05-13  added futex support (andrei)
37 38
  *
38 39
 Implements:
39 40
 
... ...
@@ -44,7 +45,7 @@ Implements:
44 44
 	void    lock_get(gen_lock_t* lock);      - lock (mutex down)
45 45
 	void    lock_release(gen_lock_t* lock);  - unlock (mutex up)
46 46
 	int     lock_try(gen_lock_t* lock);      - tries to get the lock, returns
47
-	                                            0 on success and -1 on failure
47
+	                                            0 on success and !=0 on failure
48 48
 	
49 49
 	lock sets: 
50 50
 	----------
... ...
@@ -55,7 +56,7 @@ Implements:
55 55
 	                                                   set
56 56
 	int  lock_set_try(gen_lock_set_t* s, int i);    - tries to lock the sem i,
57 57
 	                                                  returns 0 on success and
58
-	                                                  -1 on failure
58
+	                                                  !=0 on failure
59 59
 	
60 60
 	defines:
61 61
 	--------
... ...
@@ -80,8 +81,24 @@ WARNING: - lock_set_init may fail for large number of sems (e.g. sysv).
80 80
 #ifndef _lock_ops_h
81 81
 #define _lock_ops_h
82 82
 
83
+#ifdef USE_FUTEX
84
+#include "futexlock.h"
85
+/* if no native atomic ops support => USE_FUTEX will be undefined */
86
+#endif
87
+
88
+
89
+#ifdef USE_FUTEX
90
+
91
+typedef futex_lock_t gen_lock_t;
92
+
93
+#define lock_destroy(lock) /* do nothing */
94
+#define lock_init(lock) futex_init(lock)
95
+#define lock_try(lock)  futex_try(lock)
96
+#define lock_get(lock)  futex_get(lock)
97
+#define lock_release(lock) futex_release(lock)
98
+
83 99
 
84
-#ifdef FAST_LOCK
100
+#elif defined FAST_LOCK
85 101
 #include "fastlock.h"
86 102
 
87 103
 typedef fl_lock_t gen_lock_t;
... ...
@@ -263,7 +280,8 @@ tryagain:
263 263
 
264 264
 /* lock sets */
265 265
 
266
-#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || defined(USE_POSIX_SEM)
266
+#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || \
267
+	defined(USE_POSIX_SEM) || defined(USE_FUTEX)
267 268
 #define GEN_LOCK_T_PREFERRED
268 269
 #define GEN_LOCK_T_PREFERED  /* backwards compat. */
269 270
 #define GEN_LOCK_T_UNLIMITED
270 271
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+/* 
1
+ * $Id$
2
+ * 
3
+ * Copyright (C) 2007 iptelorg GmbH
4
+ *
5
+ * Permission to use, copy, modify, and distribute this software for any
6
+ * purpose with or without fee is hereby granted, provided that the above
7
+ * copyright notice and this permission notice appear in all copies.
8
+ *
9
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+ */
17
+/*
18
+ * lock_ops init functions
19
+ */
20
+/* 
21
+ * History:
22
+ * --------
23
+ *  2007-05-14  created by andrei
24
+ */
25
+
26
+#ifndef __lock_ops_init_h
27
+#define __lock_ops_init_h
28
+
29
+int init_lock_ops();
30
+void destroy_lock_ops();
31
+
32
+#endif
... ...
@@ -144,6 +144,7 @@
144 144
 #include "usr_avp.h"
145 145
 #include "core_cmd.h"
146 146
 #include "flags.h"
147
+#include "lock_ops_init.h"
147 148
 #include "atomic_ops_init.h"
148 149
 #ifdef USE_DNS_CACHE
149 150
 #include "dns_cache.h"
... ...
@@ -470,6 +471,7 @@ void cleanup(show_status)
470 470
 	/* zero all shmem alloc vars that we still use */
471 471
 	shm_mem_destroy();
472 472
 #endif
473
+	destroy_lock_ops();
473 474
 	if (pid_file) unlink(pid_file);
474 475
 	if (pgid_file) unlink(pgid_file);
475 476
 }
... ...
@@ -1429,6 +1431,9 @@ try_again:
1429 1429
 		dont_daemonize = dont_fork == 2;
1430 1430
 		dont_fork = dont_fork == 1;
1431 1431
 	}
1432
+	/* init locks first */
1433
+	if (init_lock_ops()!=0)
1434
+		goto error;
1432 1435
 	/* init the resolver, before fixing the config */
1433 1436
 	resolv_init();
1434 1437
 	/* fix parameters */
... ...
@@ -46,6 +46,9 @@ $(NAME)_pmutex: $(NAME).c
46 46
 $(NAME)_fastlock: $(NAME).c
47 47
 	gcc $(CFLAGS) $(DEFS) -DFAST_LOCK -o $@ $(INCLUDE) $< $(LIBS) 
48 48
 
49
+$(NAME)_futex: $(NAME).c
50
+	gcc $(CFLAGS) $(DEFS) -DFUTEX -o $@ $(INCLUDE) $< $(LIBS) 
51
+
49 52
 all: $(NAME) $(NAME)_sysv  $(NAME)_posix $(NAME)_pmutex \
50 53
 		$(NAME)_fastlock
51 54
 
... ...
@@ -58,6 +58,12 @@ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
58 58
 fl_lock_t lock;
59 59
 #endif
60 60
 
61
+#ifdef FUTEX
62
+#define USE_FUTEX
63
+#include "../../futexlock.h"
64
+futex_lock_t lock;
65
+#endif
66
+
61 67
 #ifdef SYSV_SEM
62 68
 #include <sys/ipc.h>
63 69
 #include <sys/sem.h>
... ...
@@ -123,6 +129,11 @@ static int semid=-1;
123 123
 		get_lock(&lock)
124 124
 	#define UNLOCK() \
125 125
 		release_lock(&lock)
126
+#elif defined FUTEX
127
+	#define LOCK() \
128
+		futex_get(&lock)
129
+	#define UNLOCK() \
130
+		futex_release(&lock)
126 131
 #endif
127 132
 
128 133
 
... ...
@@ -139,9 +150,11 @@ static char *version="locking_test 0.1-"
139 139
 #elif defined POSIX_SEM
140 140
  "posix_sem"
141 141
 #elif defined PTHREAD_MUTEX
142
- "pthread_mutext"
142
+ "pthread_mutex"
143 143
 #elif defined FAST_LOCK
144 144
  "fast_lock"
145
+#elif defined FUTEX
146
+ "futex"
145 147
 #endif
146 148
 ;
147 149
 
... ...
@@ -263,6 +276,9 @@ int main (int argc, char** argv)
263 263
 #elif defined FAST_LOCK
264 264
 	puts("Initializing fast lock\n");
265 265
 	init_lock(lock);
266
+#elif defined FUTEX
267
+	puts("Initializing futex lock\n");
268
+	futex_init(&lock);
266 269
 #endif
267 270
 
268 271
 
... ...
@@ -35,6 +35,9 @@
35 35
 #include <grp.h>
36 36
 #include <stdlib.h>
37 37
 #include <time.h>
38
+#include <sys/utsname.h> /* uname() */
39
+
40
+
38 41
 #include "ut.h"
39 42
 #include "mem/mem.h"
40 43
 
... ...
@@ -141,3 +144,40 @@ char* as_asciiz(str* s)
141 141
     r[s->len] = '\0';
142 142
     return r;
143 143
 }
144
+
145
+
146
+
147
+/* return system version (major.minor.minor2) as
148
+ *  (major<<16)|(minor)<<8|(minor2)
149
+ * (if some of them are missing, they are set to 0)
150
+ * if the parameters are not null they are set to the coresp. part 
151
+ */
152
+unsigned int get_sys_version(int* major, int* minor, int* minor2)
153
+{
154
+	struct utsname un;
155
+	int m1;
156
+	int m2;
157
+	int m3;
158
+	char* p;
159
+	
160
+	memset (&un, 0, sizeof(un));
161
+	m1=m2=m3=0;
162
+	/* get sys version */
163
+	uname(&un);
164
+	m1=strtol(un.release, &p, 10);
165
+	if (*p=='.'){
166
+		p++;
167
+		m2=strtol(p, &p, 10);
168
+		if (*p=='.'){
169
+			p++;
170
+			m3=strtol(p, &p, 10);
171
+		}
172
+	}
173
+	if (major) *major=m1;
174
+	if (minor) *minor=m2;
175
+	if (minor2) *minor2=m3;
176
+	return ((m1<<16)|(m2<<8)|(m3));
177
+}
178
+
179
+
180
+
... ...
@@ -39,6 +39,7 @@
39 39
  * 2004-03-08 updated int2str (64 bits, INT2STR_MAX_LEN used) (andrei)
40 40
  * 2005-11-29 reverse_hex2int/int2reverse_hex switched to unsigned int (andrei)
41 41
  * 2005-12-09 added msgid_var (andrei)
42
+ * 2007-05-14 added get_sys_ver() (andrei)
42 43
  */
43 44
 
44 45
 
... ...
@@ -510,4 +511,11 @@ time_t _timegm(struct tm* t);
510 510
  */
511 511
 char* as_asciiz(str* s);
512 512
 
513
+
514
+/* return system version (major.minor.minor2) as
515
+ *  (major<<16)|(minor)<<8|(minor2)
516
+ * (if some of them are missing, they are set to 0)
517
+ * if the parameters are not null they are set to the coresp. part */
518
+unsigned int get_sys_version(int* major, int* minor, int* minor2);
519
+
513 520
 #endif
... ...
@@ -167,6 +167,13 @@
167 167
 #define TIMER_DEBUG_STR ""
168 168
 #endif
169 169
 
170
+#ifdef USE_FUTEX
171
+#define USE_FUTEX_STR ", USE_FUTEX"
172
+#else
173
+#define USE_FUTEX_STR ""
174
+#endif
175
+
176
+
170 177
 #ifdef FAST_LOCK
171 178
 #ifdef BUSY_WAIT
172 179
 #define FAST_LOCK_STR ", FAST_LOCK-BUSY_WAIT"
... ...
@@ -247,7 +254,7 @@
247 247
 	USE_STUN_STR DISABLE_NAGLE_STR USE_MCAST_STR NO_DEBUG_STR NO_LOG_STR \
248 248
 	NO_SIG_DEBUG_STR DNS_IP_HACK_STR  SHM_MEM_STR SHM_MMAP_STR PKG_MALLOC_STR \
249 249
 	VQ_MALLOC_STR F_MALLOC_STR USE_SHM_MEM_STR DBG_QM_MALLOC_STR \
250
-	DBG_F_MALLOC_STR DEBUG_DMALLOC_STR TIMER_DEBUG_STR \
250
+	DBG_F_MALLOC_STR DEBUG_DMALLOC_STR TIMER_DEBUG_STR USE_FUTEX_STR \
251 251
 	FAST_LOCK_STR NOSMP_STR USE_PTHREAD_MUTEX_STR USE_POSIX_SEM_STR \
252 252
 	USE_SYSV_SEM_STR USE_COMP_STR USE_DNS_CACHE_STR USE_DNS_FAILOVER_STR \
253 253
 	USE_DST_BLACKLIST_STR