From: Michiel van Baak Date: Fri, 4 Sep 2009 13:56:10 +0000 (+0000) Subject: make asterisk compile under devmode with DEBUG_THREADS enabled on OpenBSD X-Git-Tag: 1.4.27-rc1~2^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8edfe07e6d1e56d521a08bf5b4d54a14ce1d4303;p=thirdparty%2Fasterisk.git make asterisk compile under devmode with DEBUG_THREADS enabled on OpenBSD git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@216435 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h index 471c938f24..be2bf3beae 100644 --- a/include/asterisk/lock.h +++ b/include/asterisk/lock.h @@ -1027,7 +1027,7 @@ static inline int _ast_rwlock_timedrdlock(ast_rwlock_t *lock, const char *name, do { struct timeval _start = ast_tvnow(), _diff; for (;;) { - if (!(res = pthread_rwlock_tryrdlock(&t->lock))) { + if (!(res = pthread_rwlock_tryrdlock(lock))) { break; } _diff = ast_tvsub(ast_tvnow(), _start); @@ -1076,7 +1076,7 @@ static inline int _ast_rwlock_timedwrlock(ast_rwlock_t *lock, const char *name, do { struct timeval _start = ast_tvnow(), _diff; for (;;) { - if (!(res = pthread_rwlock_trywrlock(&t->lock))) { + if (!(res = pthread_rwlock_trywrlock(lock))) { break; } _diff = ast_tvsub(ast_tvnow(), _start); diff --git a/main/utils.c b/main/utils.c index 8c601b3d71..ff8b369284 100644 --- a/main/utils.c +++ b/main/utils.c @@ -726,7 +726,7 @@ static int handle_show_locks(int fd, int argc, char *argv[]) AST_LIST_TRAVERSE(&lock_infos, lock_info, entry) { int i; if (lock_info->num_locks) { - ast_dynamic_str_append(&str, 0, "=== Thread ID: %u (%s)\n", (int) lock_info->thread_id, + ast_dynamic_str_append(&str, 0, "=== Thread ID: %ld (%s)\n", (long) lock_info->thread_id, lock_info->thread_name); pthread_mutex_lock(&lock_info->lock); for (i = 0; str && i < lock_info->num_locks; i++) {