diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-06 02:29:18 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-06 02:29:18 +0000 |
commit | 7b1b9f53ef47abd82c6faba12f4adcf721e622da (patch) | |
tree | be967c9ab3099202d13219196b5f17284a939e78 /res/res_musiconhold.c | |
parent | d39208dd35ce0ead92bf6a4b21361f3d13759589 (diff) |
more efficient (and understandable) ast_channel_walk_locked, and vastly more efficient ast_channel_by_name_locked (bug #4265)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5853 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_musiconhold.c')
-rwxr-xr-x | res/res_musiconhold.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index df018b429..3b8c5b098 100755 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -962,10 +962,11 @@ static void ast_moh_destroy(void) ast_mutex_unlock(&moh_lock); } -static void moh_on_off(int on) { - struct ast_channel *chan = ast_channel_walk_locked(NULL); +static void moh_on_off(int on) +{ + struct ast_channel *chan = NULL; - while (chan) { + while ( (chan = ast_channel_walk_locked(chan)) != NULL) { if (ast_test_flag(chan, AST_FLAG_MOH)) { if (on) local_ast_moh_start(chan, NULL); @@ -973,7 +974,6 @@ static void moh_on_off(int on) { ast_deactivate_generator(chan); } ast_mutex_unlock(&chan->lock); - chan = ast_channel_walk_locked(chan); } } |