diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-05 00:45:39 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-05 00:45:39 +0000 |
commit | 4be40c5d13ed6d3782e2c9940e5468c25aed6c4b (patch) | |
tree | e9a44da76325eca5e3b076598d0c0f942ba23780 /funcs/func_global.c | |
parent | 8e4b2b7d2166c2ab4ff5ce0fdda3413e645decce (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@105899 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_global.c')
-rw-r--r-- | funcs/func_global.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/funcs/func_global.c b/funcs/func_global.c index 1f88d0017..d97379ce9 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; } |