From: Russell Bryant Date: Wed, 5 Mar 2008 00:45:39 +0000 (+0000) Subject: Fix the SHARED() read callback to properly unlock the channel. This function X-Git-Tag: 1.6.0-beta7~223 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=39b9f810163ea0c25e78f98907f28563ccbae277;p=thirdparty%2Fasterisk.git 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105899 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_global.c b/funcs/func_global.c index 1f88d0017e..d97379ce91 100644 --- a/funcs/func_global.c +++ b/funcs/func_global.c @@ -109,8 +109,11 @@ static int shared_read(struct ast_channel *chan, const char *cmd, char *data, ch } 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'; @@ -122,6 +125,8 @@ static int shared_read(struct ast_channel *chan, const char *cmd, char *data, ch } } + ast_channel_unlock(chan); + return 0; }