From: Stefan Metzmacher Date: Thu, 21 Jun 2018 22:04:48 +0000 (+0200) Subject: pthreadpool: use unsigned for num_idle, num_threads and max_threads X-Git-Tag: ldb-1.5.0~336 X-Git-Url: http://git.samba.org/samba.git/?p=garming%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=5e723bc6f122223252b8d3c67b7b1f17121dd49a pthreadpool: use unsigned for num_idle, num_threads and max_threads These can't get negative. Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- diff --git a/lib/pthreadpool/pthreadpool.c b/lib/pthreadpool/pthreadpool.c index 92a88c9ca84..0ab6f63dbf4 100644 --- a/lib/pthreadpool/pthreadpool.c +++ b/lib/pthreadpool/pthreadpool.c @@ -78,17 +78,17 @@ struct pthreadpool { /* * maximum number of threads */ - int max_threads; + unsigned max_threads; /* * Number of threads */ - int num_threads; + unsigned num_threads; /* * Number of idle threads */ - int num_idle; + unsigned num_idle; /* * Condition variable indicating that helper threads should @@ -206,7 +206,7 @@ static void pthreadpool_prepare_pool(struct pthreadpool *pool) assert(ret == 0); while (pool->num_idle != 0) { - int num_idle = pool->num_idle; + unsigned num_idle = pool->num_idle; pthread_cond_t prefork_cond; ret = pthread_cond_init(&prefork_cond, NULL);