[asterisk-commits] russell: branch 1.4 r164881 - /branches/1.4/main/utils.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 16 15:38:30 CST 2008


Author: russell
Date: Tue Dec 16 15:38:29 2008
New Revision: 164881

URL: http://svn.digium.com/view/asterisk?view=rev&rev=164881
Log:
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

Modified:
    branches/1.4/main/utils.c

Modified: branches/1.4/main/utils.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/utils.c?view=diff&rev=164881&r1=164880&r2=164881
==============================================================================
--- branches/1.4/main/utils.c (original)
+++ branches/1.4/main/utils.c Tue Dec 16 15:38:29 2008
@@ -515,6 +515,12 @@
 
 
 	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,




More information about the asterisk-commits mailing list