This would fix a bug where the exit function of the threadpool would hang
if no jobs were processed yet and a request to exit was received.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
pthread_cleanup_push(thread_pool__threadfunc_cleanup, NULL);
while (running) {
- struct thread_pool__job *curjob;
+ struct thread_pool__job *curjob = NULL;
mutex_lock(&job_mutex);
while (running && (curjob = thread_pool__job_pop_locked()) == NULL)