]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
make asterisk compile under devmode with DEBUG_THREADS enabled on OpenBSD
authorMichiel van Baak <michiel@vanbaak.info>
Fri, 4 Sep 2009 13:56:10 +0000 (13:56 +0000)
committerMichiel van Baak <michiel@vanbaak.info>
Fri, 4 Sep 2009 13:56:10 +0000 (13:56 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@216435 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/lock.h
main/utils.c

index 471c938f2431d2be33869e85a54cd0dfb14bb51e..be2bf3beaec51f94b16702d6fbd44672dab5741a 100644 (file)
@@ -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);
index 8c601b3d71a30d848bf6d5b83cbb73c25e36f0c5..ff8b3692844dc56ae33cf1de6b311806231eea0d 100644 (file)
@@ -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++) {