Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
static bool pthreadpool_get_job(struct pthreadpool *p,
struct pthreadpool_job *job)
{
+ if (p->shutdown) {
+ return false;
+ }
+
if (p->num_jobs == 0) {
return false;
}
}
}
- if ((pool->num_jobs == 0) && pool->shutdown) {
+ if (pool->shutdown) {
/*
- * No more work to do and we're asked to shut down, so
- * exit
+ * we're asked to shut down, so exit
*/
pthreadpool_server_exit(pool);
return NULL;