mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
more efficient (and understandable) ast_channel_walk_locked, and vastly more efficient ast_channel_by_name_locked (bug #4265)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1661,10 +1661,9 @@ int load_module(void)
|
||||
|
||||
int ast_pickup_call(struct ast_channel *chan)
|
||||
{
|
||||
struct ast_channel *cur;
|
||||
struct ast_channel *cur = NULL;
|
||||
int res = -1;
|
||||
cur = ast_channel_walk_locked(NULL);
|
||||
while(cur) {
|
||||
while ( (cur = ast_channel_walk_locked(cur)) != NULL) {
|
||||
if (!cur->pbx &&
|
||||
(cur != chan) &&
|
||||
(chan->pickupgroup & cur->callgroup) &&
|
||||
@@ -1673,7 +1672,6 @@ int ast_pickup_call(struct ast_channel *chan)
|
||||
break;
|
||||
}
|
||||
ast_mutex_unlock(&cur->lock);
|
||||
cur = ast_channel_walk_locked(cur);
|
||||
}
|
||||
if (cur) {
|
||||
if (option_debug)
|
||||
|
||||
Reference in New Issue
Block a user