memcpy(&thread->ffinfo.sin, &thread->iosin, sizeof(thread->ffinfo.sin));
thread->ffinfo.type = fh->type;
thread->ffinfo.csub = fh->csub;
+ AST_LIST_INSERT_HEAD(&active_list, thread, list);
}
AST_LIST_UNLOCK(&active_list);
}
if (thread->iostate == IAX_IOSTATE_IDLE)
continue;
- /* Add ourselves to the active list now */
- AST_LIST_LOCK(&active_list);
- AST_LIST_INSERT_HEAD(&active_list, thread, list);
- AST_LIST_UNLOCK(&active_list);
-
/* See what we need to do */
switch(thread->iostate) {
case IAX_IOSTATE_READY:
thread->curfunc[0]='\0';
#endif
- /* Now... remove ourselves from the active list, and return to the idle list */
+ /* The network thread added us to the active_thread list when we were given
+ * frames to process, Now that we are done, we must remove ourselves from
+ * the active list, and return to the idle list */
AST_LIST_LOCK(&active_list);
AST_LIST_REMOVE(&active_list, thread, list);
AST_LIST_UNLOCK(&active_list);