pthreadpool: Use detached threads
commit77b7dea2d988a9944f795e2efae24aeb16009f5f
authorVolker Lendecke <vl@samba.org>
Fri, 9 Sep 2016 11:07:57 +0000 (9 13:07 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 4 Oct 2016 22:06:21 +0000 (5 00:06 +0200)
treeacbec261c8100ad86da1577fbf89a893a3758b4a
parent2d6b6c24469d2207132d16cb23b32697e3371134
pthreadpool: Use detached threads

So far we used joinable threads. This prevented pthreadpool_destroy with
blocked threads. This patch converts pthreadpool to detached threads. Now
pthreadpool_destroy does not have to wait for the idle threads to finish, it
can immediately return. pthreadpool_destroy will tell all threads to exit, and
the last active thread will actually free(pthreadpool).

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/pthreadpool/pthreadpool.c
source3/lib/pthreadpool/pthreadpool.h