[svn-commits] mmichelson: branch 1.4 r109226 - /branches/1.4/main/utils.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 17 17:05:49 CDT 2008


Author: mmichelson
Date: Mon Mar 17 17:05:49 2008
New Revision: 109226

URL: http://svn.digium.com/view/asterisk?view=rev&rev=109226
Log:
Fix a logic flaw in the code that stores lock info which is displayed
via the "core show locks" command. The idea behind this section of code was
to remove the previous lock from the list if it was a trylock that had failed.
Unfortunately, instead of checking the status of the previous lock, we were referencing
the index immediately following the previous lock in the lock_info->locks array. 
The result of this problem, under the right circumstances, was that the lock which 
we currently in the process of attempting to acquire could "overwrite" the previous lock 
which was acquired. While this does not in any way affect typical operation, it *could*
lead to misleading "core show locks" output.



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=109226&r1=109225&r2=109226
==============================================================================
--- branches/1.4/main/utils.c (original)
+++ branches/1.4/main/utils.c Mon Mar 17 17:05:49 2008
@@ -611,7 +611,7 @@
 		return;
 	}
 
-	if (i && lock_info->locks[i].pending == -1) {
+	if (i && lock_info->locks[i-1].pending == -1) {
 		/* The last lock on the list was one that this thread tried to lock but
 		 * failed at doing so.  It has now moved on to something else, so remove
 		 * the old lock from the list. */




More information about the svn-commits mailing list