From 8edfe07e6d1e56d521a08bf5b4d54a14ce1d4303 Mon Sep 17 00:00:00 2001 From: Michiel van Baak Date: Fri, 4 Sep 2009 13:56:10 +0000 Subject: [PATCH] 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 --- include/asterisk/lock.h | 4 ++-- main/utils.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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++) {