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 73
 VERSION = 2
72 74
 PATCHLEVEL = 1
73 75
 SUBLEVEL =  0
74
-EXTRAVERSION = -dev2
76
+EXTRAVERSION = -dev3
75 77
 
76 78
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
77 79
 			$(SUBLEVEL) )
... ...
@@ -323,6 +325,8 @@ endif
323 325
 #		work on all systems inter-processes (e.g. linux)
324 326
 # -DUSE_POSIX_SEM
325 327
 #		uses posix semaphores for locking (faster than sys v)
328
+# -DUSE_FUTEX
329
+#		uses futexes for locking (linux 2.6+)
326 330
 # -DBUSY_WAIT
327 331
 #		uses busy waiting on the lock (FAST_LOCK)
328 332
 # -DADAPTIVE_WAIT
... ...
@@ -405,6 +409,7 @@ DEFS+= $(extra_defs) \
405 409
 	 -DUSE_DNS_FAILOVER \
406 410
 	 -DUSE_DST_BLACKLIST \
407 411
 	 -DDBG_QM_MALLOC \
412
+	 #-DF_MALLOC
408 413
 	 #-DDBG_F_MALLOC \
409 414
 	 #-DNO_DEBUG \
410 415
 	 #-DEXTRA_DEBUG \
... ...
@@ -550,6 +555,7 @@ endif
550 555
 
551 556
 ifeq ($(ARCH), alpha)
552 557
 	use_fast_lock=yes
558
+	DEFS+=-DNOSMP # very likely
553 559
 endif
554 560
 
555 561
 ifeq ($(use_fast_lock), yes)
... ...
@@ -1272,11 +1278,16 @@ LIB_SUFFIX:=.so
1272 1278
 
1273 1279
 #os specific stuff
1274 1280
 ifeq ($(OS), linux)
1281
+# by default use futexes if available
1282
+	use_futex= yes
1275 1283
 	DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
1276 1284
 			-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
1277 1285
 			-DHAVE_TIMEGM
1278 1286
 	ifneq ($(found_lock_method), yes)
1279
-		DEFS+= -DUSE_SYSV_SEM  # try posix sems
1287
+		#DEFS+= -DUSE_POSIX_SEM
1288
+		DEFS+=-DUSE_PTHREAD_MUTEX
1289
+		LIBS+= -lpthread
1290
+		#DEFS+= -DUSE_SYSV_SEM  # try posix sems
1280 1291
 		found_lock_method=yes
1281 1292
 	else
1282 1293
 		ifneq (,$(findstring -DUSE_POSIX_SEM, $(DEFS)))
... ...
@@ -1300,6 +1311,12 @@ ifeq ($(OS), linux)
1300 1311
 			DEFS+=-DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND
1301 1312
 		endif
1302 1313
 	endif
1314
+	# check for >= 2.5.70
1315
+	ifeq ($(shell [ $(OSREL_N) -ge 2005070 ] && echo has_futex), has_futex)
1316
+		ifeq ($(use_futex), yes)
1317
+			DEFS+=-DUSE_FUTEX
1318
+		endif
1319
+	endif
1303 1320
 	ifeq ($(NO_SELECT),)
1304 1321
 		DEFS+=-DHAVE_SELECT
1305 1322
 	endif
1306 1323
new file mode 100644
... ...
@@ -0,0 +1,124 @@
1
+/* 
2
+ * $Id$
3
+ * 
4
+ * Copyright (C) 2007 iptelorg GmbH
5
+ *
6
+ * Permission to use, copy, modify, and distribute this software for any
7
+ * purpose with or without fee is hereby granted, provided that the above
8
+ * copyright notice and this permission notice appear in all copies.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
+ */
18
+/*
19
+ * futex based lock (mutex) implementation  (linux 2.6+ only)
20
+ * based on Ulrich Drepper implementation in "Futexes Are Tricky"
21
+ * (http://people.redhat.com/drepper/futex.pdf)
22
+ *
23
+ * Implements:
24
+ *   void futex_get(futex_lock_t* lock);     - mutex lock
25
+ *   void futex_release(futex_lock_t* lock); - unlock
26
+ *   int  futex_try(futex_lock_t* lock);     - tries to get lock, returns 0
27
+ *                                              on success and !=0 on failure
28
+ *                                              (1 or 2)
29
+ *
30
+ *  Config defines:
31
+ */
32
+/* 
33
+ * History:
34
+ * --------
35
+ *  2007-05-13  created by andrei
36
+ */
37
+
38
+#ifndef _futexlock_h
39
+#define _futexlock_h
40
+
41
+
42
+#include "atomic/atomic_common.h"
43
+#include "atomic/atomic_native.h"
44
+
45
+#ifdef HAVE_ASM_INLINE_ATOMIC_OPS
46
+#define HAVE_FUTEX
47
+#include <linux/futex.h>
48
+#include <sys/syscall.h>
49
+#include <unistd.h>
50
+#include "compiler_opt.h"
51
+
52
+
53
+#define sys_futex(addr, op, val, timeout, addr2, val3) \
54
+	syscall(__NR_futex , (addr), (op), (val), (timeout), (addr2), (val3))
55
+
56
+typedef atomic_t futex_lock_t;
57
+
58
+/* the mutex has 3 states: 0 - free/unlocked and nobody waiting
59
+ *                         1 - locked and nobody waiting for it
60
+ *                         2 - locked w/ 0 or more waiting processes/threads
61
+ */
62
+
63
+inline static futex_lock_t* futex_init(futex_lock_t* lock)
64
+{
65
+	atomic_set(lock, 0);
66
+	return lock;
67
+}
68
+
69
+
70
+inline static void futex_get(futex_lock_t* lock)
71
+{
72
+	int v;
73
+	
74
+	v=atomic_cmpxchg(lock, 0, 1); /* lock if 0 */
75
+	if (likely(v==0)){  /* optimize for the uncontended case */
76
+		/* success */
77
+		membar_enter_lock();
78
+		return;
79
+	}else if (likely(v==2)){ /* if contended, optimize for the several waiters
80
+								case */
81
+		/* waiting processes/threads => add ourselves to the queue */
82
+		do{
83
+			sys_futex(&(lock)->val, FUTEX_WAIT, 2, 0, 0, 0);
84
+			v=atomic_get_and_set(lock, 2);
85
+		}while(v);
86
+	}else{
87
+		/* v==1 */
88
+		v=atomic_get_and_set(lock, 2);
89
+		while(v){
90
+			sys_futex(&(lock)->val, FUTEX_WAIT, 2, 0, 0, 0);
91
+			v=atomic_get_and_set(lock, 2);
92
+		}
93
+	}
94
+	membar_enter_lock();
95
+}
96
+
97
+
98
+inline static void futex_release(futex_lock_t* lock)
99
+{
100
+	int v;
101
+	
102
+	membar_leave_lock();
103
+	v=atomic_get_and_set(lock, 0);
104
+	if (unlikely(v==2)){ /* optimize for the uncontended case */
105
+		sys_futex(&(lock)->val, FUTEX_WAKE, 1, 0, 0, 0);
106
+	}
107
+}
108
+
109
+
110
+static inline int futex_try(futex_lock_t* lock)
111
+{
112
+	int c;
113
+	c=atomic_cmpxchg(lock, 0, 1);
114
+	if (likely(c))
115
+		membar_enter_lock();
116
+	return c;
117
+}
118
+
119
+
120
+#else /*HAVE_ASM_INLINE_ATOMIC_OPS*/
121
+#undef USE_FUTEX
122
+#endif /*HAVE_ASM_INLINE_ATOMIC_OPS*/
123
+
124
+#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 @@
1
+/* 
2
+ * $Id$
3
+ * 
4
+ * Copyright (C) 2007 iptelorg GmbH
5
+ *
6
+ * Permission to use, copy, modify, and distribute this software for any
7
+ * purpose with or without fee is hereby granted, provided that the above
8
+ * copyright notice and this permission notice appear in all copies.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
+ */
18
+/*
19
+ *  lock operations init
20
+ */
21
+/* 
22
+ * History:
23
+ * --------
24
+ *  2007-05-14  created by andrei
25
+ */
26
+
27
+#include "lock_ops.h"
28
+#include "ut.h"
29
+#include "dprint.h"
30
+
31
+/* returns 0 on success, -1 on error */
32
+int init_lock_ops()
33
+{
34
+#ifdef USE_FUTEX
35
+	int os_ver;
36
+	
37
+	os_ver=get_sys_version(0, 0, 0);
38
+	if (os_ver < 0x020546 ){ /* if ver < 2.5.70 */
39
+		LOG(L_CRIT, "ERROR: init_lock_ops: old kernel:"
40
+				" compiled with FUTEX support which is not present in the"
41
+				" running kernel (try  2.6+)\n");
42
+		return -1;
43
+	}
44
+#endif
45
+	return 0;
46
+}
47
+
48
+
49
+
50
+void destroy_lock_ops()
51
+{
52
+}
... ...
@@ -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 45
 	void    lock_get(gen_lock_t* lock);      - lock (mutex down)
45 46
 	void    lock_release(gen_lock_t* lock);  - unlock (mutex up)
46 47
 	int     lock_try(gen_lock_t* lock);      - tries to get the lock, returns
47
-	                                            0 on success and -1 on failure
48
+	                                            0 on success and !=0 on failure
48 49
 	
49 50
 	lock sets: 
50 51
 	----------
... ...
@@ -55,7 +56,7 @@ Implements:
55 56
 	                                                   set
56 57
 	int  lock_set_try(gen_lock_set_t* s, int i);    - tries to lock the sem i,
57 58
 	                                                  returns 0 on success and
58
-	                                                  -1 on failure
59
+	                                                  !=0 on failure
59 60
 	
60 61
 	defines:
61 62
 	--------
... ...
@@ -80,8 +81,24 @@ WARNING: - lock_set_init may fail for large number of sems (e.g. sysv).
80 81
 #ifndef _lock_ops_h
81 82
 #define _lock_ops_h
82 83
 
84
+#ifdef USE_FUTEX
85
+#include "futexlock.h"
86
+/* if no native atomic ops support => USE_FUTEX will be undefined */
87
+#endif
88
+
89
+
90
+#ifdef USE_FUTEX
91
+
92
+typedef futex_lock_t gen_lock_t;
93
+
94
+#define lock_destroy(lock) /* do nothing */
95
+#define lock_init(lock) futex_init(lock)
96
+#define lock_try(lock)  futex_try(lock)
97
+#define lock_get(lock)  futex_get(lock)
98
+#define lock_release(lock) futex_release(lock)
99
+
83 100
 
84
-#ifdef FAST_LOCK
101
+#elif defined FAST_LOCK
85 102
 #include "fastlock.h"
86 103
 
87 104
 typedef fl_lock_t gen_lock_t;
... ...
@@ -263,7 +280,8 @@ tryagain:
263 280
 
264 281
 /* lock sets */
265 282
 
266
-#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || defined(USE_POSIX_SEM)
283
+#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || \
284
+	defined(USE_POSIX_SEM) || defined(USE_FUTEX)
267 285
 #define GEN_LOCK_T_PREFERRED
268 286
 #define GEN_LOCK_T_PREFERED  /* backwards compat. */
269 287
 #define GEN_LOCK_T_UNLIMITED
270 288
new file mode 100644
... ...
@@ -0,0 +1,33 @@
1
+/* 
2
+ * $Id$
3
+ * 
4
+ * Copyright (C) 2007 iptelorg GmbH
5
+ *
6
+ * Permission to use, copy, modify, and distribute this software for any
7
+ * purpose with or without fee is hereby granted, provided that the above
8
+ * copyright notice and this permission notice appear in all copies.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
+ */
18
+/*
19
+ * lock_ops init functions
20
+ */
21
+/* 
22
+ * History:
23
+ * --------
24
+ *  2007-05-14  created by andrei
25
+ */
26
+
27
+#ifndef __lock_ops_init_h
28
+#define __lock_ops_init_h
29
+
30
+int init_lock_ops();
31
+void destroy_lock_ops();
32
+
33
+#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 471
 	/* zero all shmem alloc vars that we still use */
471 472
 	shm_mem_destroy();
472 473
 #endif
474
+	destroy_lock_ops();
473 475
 	if (pid_file) unlink(pid_file);
474 476
 	if (pgid_file) unlink(pgid_file);
475 477
 }
... ...
@@ -1429,6 +1431,9 @@ try_again:
1429 1431
 		dont_daemonize = dont_fork == 2;
1430 1432
 		dont_fork = dont_fork == 1;
1431 1433
 	}
1434
+	/* init locks first */
1435
+	if (init_lock_ops()!=0)
1436
+		goto error;
1432 1437
 	/* init the resolver, before fixing the config */
1433 1438
 	resolv_init();
1434 1439
 	/* 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 129
 		get_lock(&lock)
124 130
 	#define UNLOCK() \
125 131
 		release_lock(&lock)
132
+#elif defined FUTEX
133
+	#define LOCK() \
134
+		futex_get(&lock)
135
+	#define UNLOCK() \
136
+		futex_release(&lock)
126 137
 #endif
127 138
 
128 139
 
... ...
@@ -139,9 +150,11 @@ static char *version="locking_test 0.1-"
139 150
 #elif defined POSIX_SEM
140 151
  "posix_sem"
141 152
 #elif defined PTHREAD_MUTEX
142
- "pthread_mutext"
153
+ "pthread_mutex"
143 154
 #elif defined FAST_LOCK
144 155
  "fast_lock"
156
+#elif defined FUTEX
157
+ "futex"
145 158
 #endif
146 159
 ;
147 160
 
... ...
@@ -263,6 +276,9 @@ int main (int argc, char** argv)
263 276
 #elif defined FAST_LOCK
264 277
 	puts("Initializing fast lock\n");
265 278
 	init_lock(lock);
279
+#elif defined FUTEX
280
+	puts("Initializing futex lock\n");
281
+	futex_init(&lock);
266 282
 #endif
267 283
 
268 284
 
... ...
@@ -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 144
     r[s->len] = '\0';
142 145
     return r;
143 146
 }
147
+
148
+
149
+
150
+/* return system version (major.minor.minor2) as
151
+ *  (major<<16)|(minor)<<8|(minor2)
152
+ * (if some of them are missing, they are set to 0)
153
+ * if the parameters are not null they are set to the coresp. part 
154
+ */
155
+unsigned int get_sys_version(int* major, int* minor, int* minor2)
156
+{
157
+	struct utsname un;
158
+	int m1;
159
+	int m2;
160
+	int m3;
161
+	char* p;
162
+	
163
+	memset (&un, 0, sizeof(un));
164
+	m1=m2=m3=0;
165
+	/* get sys version */
166
+	uname(&un);
167
+	m1=strtol(un.release, &p, 10);
168
+	if (*p=='.'){
169
+		p++;
170
+		m2=strtol(p, &p, 10);
171
+		if (*p=='.'){
172
+			p++;
173
+			m3=strtol(p, &p, 10);
174
+		}
175
+	}
176
+	if (major) *major=m1;
177
+	if (minor) *minor=m2;
178
+	if (minor2) *minor2=m3;
179
+	return ((m1<<16)|(m2<<8)|(m3));
180
+}
181
+
182
+
183
+
... ...
@@ -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 511
  */
511 512
 char* as_asciiz(str* s);
512 513
 
514
+
515
+/* return system version (major.minor.minor2) as
516
+ *  (major<<16)|(minor)<<8|(minor2)
517
+ * (if some of them are missing, they are set to 0)
518
+ * if the parameters are not null they are set to the coresp. part */
519
+unsigned int get_sys_version(int* major, int* minor, int* minor2);
520
+
513 521
 #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 254
 	USE_STUN_STR DISABLE_NAGLE_STR USE_MCAST_STR NO_DEBUG_STR NO_LOG_STR \
248 255
 	NO_SIG_DEBUG_STR DNS_IP_HACK_STR  SHM_MEM_STR SHM_MMAP_STR PKG_MALLOC_STR \
249 256
 	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 \
257
+	DBG_F_MALLOC_STR DEBUG_DMALLOC_STR TIMER_DEBUG_STR USE_FUTEX_STR \
251 258
 	FAST_LOCK_STR NOSMP_STR USE_PTHREAD_MUTEX_STR USE_POSIX_SEM_STR \
252 259
 	USE_SYSV_SEM_STR USE_COMP_STR USE_DNS_CACHE_STR USE_DNS_FAILOVER_STR \
253 260
 	USE_DST_BLACKLIST_STR