From: Russell Bryant Date: Tue, 16 Dec 2008 21:39:15 +0000 (+0000) Subject: Merged revisions 164881 via svnmerge from X-Git-Tag: 1.6.2.0-beta1~581 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8da171dd19a176a16e7711764d7b341cb521174;p=thirdparty%2Fasterisk.git Merged revisions 164881 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r164881 | russell | 2008-12-16 15:38:29 -0600 (Tue, 16 Dec 2008) | 9 lines Fix an issue where DEBUG_THREADS may erroneously report that a thread is exiting while holding a lock. If the last lock attempt was a trylock, and it failed, it will still be in the list of locks so that it can be reported. (closes issue #13219) Reported by: pj ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164882 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/utils.c b/main/utils.c index e3d64c3dc2..64a5475261 100644 --- a/main/utils.c +++ b/main/utils.c @@ -520,6 +520,12 @@ static void lock_info_destroy(void *data) for (i = 0; i < lock_info->num_locks; i++) { + if (lock_info->locks[i].pending == -1) { + /* This just means that the last lock this thread went for was by + * using trylock, and it failed. This is fine. */ + break; + } + ast_log(LOG_ERROR, "Thread '%s' still has a lock! - '%s' (%p) from '%s' in %s:%d!\n", lock_info->thread_name,