mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 22:45:39 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@38871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -829,12 +829,9 @@ static struct iax2_thread *find_idle_thread(void)
|
|||||||
{
|
{
|
||||||
struct iax2_thread *thread = NULL;
|
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);
|
AST_LIST_LOCK(&idle_list);
|
||||||
thread = AST_LIST_FIRST(&idle_list);
|
thread = AST_LIST_REMOVE_HEAD(&idle_list, list);
|
||||||
if (thread != NULL) {
|
|
||||||
AST_LIST_REMOVE(&idle_list, thread, list);
|
|
||||||
}
|
|
||||||
AST_LIST_UNLOCK(&idle_list);
|
AST_LIST_UNLOCK(&idle_list);
|
||||||
|
|
||||||
/* If no idle thread is available from the regular list, try dynamic */
|
/* If no idle thread is available from the regular list, try dynamic */
|
||||||
|
Reference in New Issue
Block a user