diff src/c/urweb.c @ 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 ea131de361d9
children 225b87d4a7df
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;