Commits
Arthur Taylor committed 6cd795ab1d3
task scheduler: Wait on tasks to exit rather than sleep in loop. Revision of switch_scheduler_task_thread_stop() to wait on the condition variable for all tasks to complete rather than simply spinning in a loop with sleeps. This change also moves the deallocation into switch_scheduler_task_thread_stop(). The reason for the change is that the task_thread may be stuck in the middle of a hung task and cannot delete tasks on its own, or the task_thread may have exited before any tasks in their own thread, so we need to clean them up. Also add checks to add_task() and del_task() functions to check that the task thread is running, and have switch_scheduler_task_thread_start() block until the task thread is indeed started.