Bite the bullet and require RECURSIVE mutexes
authorMark Spencer <markster@digium.com>
Tue, 6 Apr 2004 20:08:44 +0000 (20:08 +0000)
committerMark Spencer <markster@digium.com>
Tue, 6 Apr 2004 20:08:44 +0000 (20:08 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2640 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/lock.h

index aba263c..673fb48 100755 (executable)
 #include <stdio.h>
 #include <unistd.h>
 
-// #define AST_MUTEX_INITIALIZER      PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-// #define AST_MUTEX_KIND             PTHREAD_MUTEX_RECURSIVE_NP
-#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-#define AST_MUTEX_INITIALIZER         { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, NULL, 0, NULL, 0 }
-#else
-#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
-#define AST_MUTEX_INITIALIZER         { PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP, NULL, 0, NULL, 0 }
-#else
-#define AST_MUTEX_INITIALIZER         { PTHREAD_MUTEX_INITIALIZER, NULL, 0, NULL, 0 }
-#endif
-#endif
-#ifdef PTHREAD_MUTEX_ERRORCHECK_NP
-#define AST_MUTEX_KIND                PTHREAD_MUTEX_ERRORCHECK_NP
-#else
-#define AST_MUTEX_KIND                PTHREAD_MUTEX_ERRORCHECK
-#endif
+/* From now on, Asterisk REQUIRES Recursive (not error checking) mutexes
+   and will not run without them. */
+
+#define AST_MUTEX_INITIALIZER      PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#define AST_MUTEX_KIND             PTHREAD_MUTEX_RECURSIVE_NP
 
 struct ast_mutex_info {
        pthread_mutex_t mutex;