[asterisk-commits] file: trunk r38871 - /trunk/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Aug 4 16:17:40 MST 2006


Author: file
Date: Fri Aug  4 18:17:40 2006
New Revision: 38871

URL: http://svn.digium.com/view/asterisk?rev=38871&view=rev
Log:
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.

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=38871&r1=38870&r2=38871&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Fri Aug  4 18:17:40 2006
@@ -829,12 +829,9 @@
 {
 	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 */



More information about the asterisk-commits mailing list