[asterisk-commits] mmichelson: branch mmichelson/lock_backtraces r115361 - in /team/mmichelson/l...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 6 13:46:19 CDT 2008


Author: mmichelson
Date: Tue May  6 13:46:18 2008
New Revision: 115361

URL: http://svn.digium.com/view/asterisk?view=rev&rev=115361
Log:
Now it'll compile if you specified --without-execinfo during configuration


Modified:
    team/mmichelson/lock_backtraces/include/asterisk/lock.h
    team/mmichelson/lock_backtraces/utils/ael_main.c

Modified: team/mmichelson/lock_backtraces/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/mmichelson/lock_backtraces/include/asterisk/lock.h?view=diff&rev=115361&r1=115360&r2=115361
==============================================================================
--- team/mmichelson/lock_backtraces/include/asterisk/lock.h (original)
+++ team/mmichelson/lock_backtraces/include/asterisk/lock.h Tue May  6 13:46:18 2008
@@ -110,9 +110,15 @@
 
 #include <errno.h>
 
+#ifdef HAVE_BKTR
 #define AST_MUTEX_INIT_VALUE { PTHREAD_MUTEX_INIT_VALUE, 1, { NULL }, { 0 }, 0, { NULL }, { 0 }, {{{ 0 }}}, PTHREAD_MUTEX_INIT_VALUE }
 #define AST_MUTEX_INIT_VALUE_NOTRACKING \
                              { PTHREAD_MUTEX_INIT_VALUE, 0, { NULL }, { 0 }, 0, { NULL }, { 0 }, {{{ 0 }}}, PTHREAD_MUTEX_INIT_VALUE }
+#else
+#define AST_MUTEX_INIT_VALUE { PTHREAD_MUTEX_INIT_VALUE, 1, { NULL }, { 0 }, 0, { NULL }, { 0 }, PTHREAD_MUTEX_INIT_VALUE }
+#define AST_MUTEX_INIT_VALUE_NOTRACKING \
+                             { PTHREAD_MUTEX_INIT_VALUE, 0, { NULL }, { 0 }, 0, { NULL }, { 0 }, PTHREAD_MUTEX_INIT_VALUE }
+#endif
 
 #define AST_MAX_REENTRANCY 10
 
@@ -382,7 +388,7 @@
 {
 	int res;
 	int canlog = strcmp(filename, "logger.c") & t->track;
-#if HAVE_BKTR
+#ifdef HAVE_BKTR
 	struct ast_bt *bt = NULL;
 #endif
 
@@ -558,7 +564,9 @@
 {
 	int res;
 	int canlog = strcmp(filename, "logger.c") & t->track;
+#ifdef HAVE_BKTR
 	struct ast_bt *bt = NULL;
+#endif
 
 #ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
 	if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
@@ -850,7 +858,9 @@
 
 struct ast_rwlock_info {
 	pthread_rwlock_t lock;
+#ifdef HAVE_BKTR
 	struct ast_bt backtrace;
+#endif
 };
 
 typedef struct ast_rwlock_info ast_rwlock_t;
@@ -864,10 +874,18 @@
 #define ast_rwlock_trywrlock(a) _ast_rwlock_trywrlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 #ifdef HAVE_PTHREAD_RWLOCK_INITIALIZER
+#ifdef HAVE_BKTR
 #define AST_RWLOCK_INIT_VALUE { PTHREAD_RWLOCK_INITIALIZER, {{0,},} }
 #else
+#define AST_RWLOCK_INIT_VALUE { PTHREAD_RWLOCK_INITIALIZER }
+#endif /* HAVE_BKTR */
+#else  /* HAVE_PTHREAD_RWLOCK_INITIALIZER */
+#ifdef HAVE_BKTR
 #define AST_RWLOCK_INIT_VALUE { 0 , {0,},}}
-#endif
+#else
+#define AST_RWLOCK_INIT_VALUE { 0 }
+#endif /* HAVE_BKTR */
+#endif /* HAVE_PTHREAD_RWLOCK_INITIALIZER */
 
 static inline int __ast_rwlock_init(const char *filename, int lineno, const char *func, const char *rwlock_name, ast_rwlock_t *prwlock)
 {
@@ -937,8 +955,10 @@
 	res = pthread_rwlock_unlock(&lock->lock);
 #ifdef HAVE_BKTR
 	memset(&lock->backtrace, 0, sizeof(lock->backtrace));
-#endif
 	ast_remove_lock_info(lock, NULL);
+#else
+	ast_remove_lock_info(lock);
+#endif
 	return res;
 }
 

Modified: team/mmichelson/lock_backtraces/utils/ael_main.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/lock_backtraces/utils/ael_main.c?view=diff&rev=115361&r1=115360&r2=115361
==============================================================================
--- team/mmichelson/lock_backtraces/utils/ael_main.c (original)
+++ team/mmichelson/lock_backtraces/utils/ael_main.c Tue May  6 13:46:18 2008
@@ -618,7 +618,7 @@
 {
 }
 #else
-void ast_remove_lock_info(void *lock_addr, struct ast_bt *bt)
+void ast_remove_lock_info(void *lock_addr)
 {
 }
 




More information about the asterisk-commits mailing list