[svn-commits] russell: trunk r105899 - /trunk/funcs/func_global.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 4 18:45:40 CST 2008


Author: russell
Date: Tue Mar  4 18:45:39 2008
New Revision: 105899

URL: http://svn.digium.com/view/asterisk?view=rev&rev=105899
Log:
Fix the SHARED() read callback to properly unlock the channel.  This function
could not have worked, as it left the channel locked in all cases.

Modified:
    trunk/funcs/func_global.c

Modified: trunk/funcs/func_global.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_global.c?view=diff&rev=105899&r1=105898&r2=105899
==============================================================================
--- trunk/funcs/func_global.c (original)
+++ trunk/funcs/func_global.c Tue Mar  4 18:45:39 2008
@@ -109,8 +109,11 @@
 	} else
 		ast_channel_lock(chan);
 
-	if (!(varstore = ast_channel_datastore_find(chan, &shared_variable_info, NULL)))
+	if (!(varstore = ast_channel_datastore_find(chan, &shared_variable_info, NULL))) {
+		ast_channel_unlock(chan);
 		return -1;
+	}
+
 	varshead = varstore->data;
 	*buf = '\0';
 
@@ -121,6 +124,8 @@
 			break;
 		}
 	}
+
+	ast_channel_unlock(chan);
 
 	return 0;
 }




More information about the svn-commits mailing list