diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-20 16:30:10 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-20 16:30:10 +0000 |
commit | ec76498f552e4ff10adcaa0ffc27d1c21cb5792e (patch) | |
tree | efbb775d4f7e80cb61b314075217774d082e881a /apps/app_groupcount.c | |
parent | 7e42c962d89de0673789eed30649fc7ae276aa50 (diff) |
Make ast_channel_walk become ast_channel_walk_locked
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3029 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_groupcount.c')
-rwxr-xr-x | apps/app_groupcount.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/app_groupcount.c b/apps/app_groupcount.c index ef7b92cd9..b97a77466 100755 --- a/apps/app_groupcount.c +++ b/apps/app_groupcount.c @@ -58,20 +58,17 @@ LOCAL_USER_DECL; static int group_get_count(char *group) { - /* XXX ast_channel_walk needs to be modified to - prevent a race in which after we return the channel - is no longer valid (or ast_channel_free can be modified - just as well) XXX */ struct ast_channel *chan; int count = 0; char *test; if (group && !ast_strlen_zero(group)) { - chan = ast_channel_walk(NULL); + chan = ast_channel_walk_locked(NULL); while(chan) { test = pbx_builtin_getvar_helper(chan, "GROUP"); if (test && !strcasecmp(test, group)) count++; - chan = ast_channel_walk(chan); + ast_mutex_unlock(&chan->lock); + chan = ast_channel_walk_locked(chan); } } return count; |