diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-06 14:08:54 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-06 14:08:54 +0000 |
commit | f36c90c199831bf4240be5fffe13ed53df311cb6 (patch) | |
tree | 6a1fd6335a5024feab1f589fdd13c101a07e2833 /include/asterisk/pbx.h | |
parent | fe4629867d96d86b48165d964049f60875644c5d (diff) |
Merged revisions 88805 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r88805 | russell | 2007-11-05 16:07:54 -0600 (Mon, 05 Nov 2007) | 12 lines
After seeing crashes related to channel variables, I went looking around at the
ways that channel variables are handled. In general, they were not handled in
a thread-safe way. The channel _must_ be locked when reading or writing from/to
the channel variable list.
What I have done to improve this situation is to make pbx_builtin_setvar_helper()
and friends lock the channel when doing their thing. Asterisk API calls almost
all lock the channel for you as necessary, but this family of functions did not.
(closes issue #10923, reported by atis)
(closes issue #11159, reported by 850t)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88934 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/pbx.h')
-rw-r--r-- | include/asterisk/pbx.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h index 2b6ad75e6..645c8eedd 100644 --- a/include/asterisk/pbx.h +++ b/include/asterisk/pbx.h @@ -850,14 +850,39 @@ struct ast_ignorepat *ast_walk_context_ignorepats(struct ast_context *con, struct ast_ignorepat *ip); struct ast_sw *ast_walk_context_switches(struct ast_context *con, struct ast_sw *sw); +/*! + * \note Will lock the channel. + */ int pbx_builtin_serialize_variables(struct ast_channel *chan, struct ast_str **buf); + +/*! + * \note Will lock the channel. + */ const char *pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name); + +/*! + * \note Will lock the channel. + */ void pbx_builtin_pushvar_helper(struct ast_channel *chan, const char *name, const char *value); + +/*! + * \note Will lock the channel. + */ void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value); + +/*! + * \note Will lock the channel. + */ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp); void pbx_builtin_clear_globals(void); + +/*! + * \note Will lock the channel. + */ int pbx_builtin_setvar(struct ast_channel *chan, void *data); + int pbx_builtin_raise_exception(struct ast_channel *chan, void *data); + void pbx_substitute_variables_helper(struct ast_channel *c,const char *cp1,char *cp2,int count); void pbx_substitute_variables_varshead(struct varshead *headp, const char *cp1, char *cp2, int count); |