static void *worker_start(void *arg)
{
struct worker_thread *worker = arg;
+ enum worker_state saved_state;
if (worker->options.thread_start) {
worker->options.thread_start();
}
threadpool_active_thread_idle(worker->pool, worker);
}
+ saved_state = worker->state;
ast_mutex_unlock(&worker->lock);
/* Reaching this portion means the thread is
* that the thread can be removed from the
* list of zombie threads.
*/
- if (worker->state == ZOMBIE) {
+ if (saved_state == ZOMBIE) {
threadpool_zombie_thread_dead(worker->pool, worker);
}