pthreadpool_pipe: Implement EBUSY for _destroy
commit1a3d081c995de9ff8a7047e9b77cd532c3dffa97
authorVolker Lendecke <vl@samba.org>
Fri, 9 Sep 2016 13:18:41 +0000 (9 15:18 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 4 Oct 2016 22:06:21 +0000 (5 00:06 +0200)
tree89913cf4216af157b482dfaffc41ce520cd3d479
parent77b7dea2d988a9944f795e2efae24aeb16009f5f
pthreadpool_pipe: Implement EBUSY for _destroy

Restore EBUSY on pthreadpool_pipe_destroy.

We need to count jobs in pthreadpool_pipe so that pthreadpool can exit with
active jobs. Unfortunately this makes pthreadpool_pipe_add_job non-threadsafe.
We could add mutexes around "num_jobs", but this would mean another set of
pthread_atfork functions. As we don't use threaded pthreadpool_pipe_add_job
except in the tests, just remove the tests...

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