1、将trh放到srv_sys->tasks队列

srv_que_task_enqueue_low:
UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr);
srv_release_threads(SRV_WORKER, 1);
slot->suspended = FALSE;
释放一个srv_slot:os_event_set(slot->event);
slot = &srv_sys->sys_threads[i];,i从0开始,找一个挂起的slot。

2、srv_worker_thread

srv_worker_thread:
do {
srv_suspend_thread(slot);// slot->suspended = TRUE;
os_event_wait(slot->event);//等待os_event_set
if (srv_task_execute()) {//fetch task from queue and run purge
/* If there are tasks in the queue, wakeup the purge coordinator thread. */
srv_wake_purge_thread_if_not_active();
}
/* Note: we are checking the state without holding the purge_sys->latch here. */
} while (purge_sys->state != PURGE_STATE_EXIT);

purge_sys->state在协调线程退出时置成PURGE_STATE_EXIT,所以worker线程是在协调线程退出后才退出