changeset 1679:3636d0eeb39c

Fixed clients mutex initialization for compiling under OS X.
author Vladimir Shabanov <vshabanoff@gmail.com>
date Sat, 14 Jan 2012 23:02:34 +0400
parents d05299e561c8
children 5b2c7b9f6017
files src/c/urweb.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/urweb.c	Sat Jan 14 11:24:17 2012 -0500
+++ b/src/c/urweb.c	Sat Jan 14 23:02:34 2012 +0400
@@ -159,8 +159,13 @@
 static client **clients, *clients_free, *clients_used;
 static unsigned n_clients;
 
-static pthread_mutex_t clients_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-
+static pthread_mutex_t clients_mutex =
+    #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+        PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+    #else
+        PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+    #endif
+    ;
 size_t uw_messages_max = SIZE_MAX;
 size_t uw_clients_max = SIZE_MAX;