aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-04 23:17:40 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-04 23:17:40 +0000
commit886cf39b10ed0331f0e60ba0c383490f825b440f (patch)
tree1d8dd6be168eafd5e4498e30979486fae4552ef8 /channels/chan_iax2.c
parent84c1e0fb2f2401982032dd8145e0ba1a1064e4cb (diff)
Minor optimization but use a linkedlists.h macro that pops the head off the list instead of getting the first entry and then removing it.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38871 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 70f40c45c..b2894afde 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -829,12 +829,9 @@ static struct iax2_thread *find_idle_thread(void)
{
struct iax2_thread *thread = NULL;
- /* Find free idle thread in the list, get a pointer to it, and remove it from the list */
+ /* Pop the head of the list off */
AST_LIST_LOCK(&idle_list);
- thread = AST_LIST_FIRST(&idle_list);
- if (thread != NULL) {
- AST_LIST_REMOVE(&idle_list, thread, list);
- }
+ thread = AST_LIST_REMOVE_HEAD(&idle_list, list);
AST_LIST_UNLOCK(&idle_list);
/* If no idle thread is available from the regular list, try dynamic */