pthreadpool: Rearrange locks a bit
commit1e676a6e2c71ceb1f9bf693d94b750c1ebcb95dd
authorVolker Lendecke <vl@samba.org>
Wed, 12 Oct 2016 10:12:28 +0000 (12 12:12 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 14 Oct 2016 19:45:08 +0000 (14 21:45 +0200)
tree8a122aa7e6bf22b3a35d6c22d3d2b45fc7a19801
parent9f6fe5e2c54870abfff48c8a9d96e21bfec2425f
pthreadpool: Rearrange locks a bit

Coverity ID 1373624 says we have a deadlock between pthreadpool_prepare and
pthreadpool_destroy. Coverity somehow misses that pthreadpool_free unlocks
pool->mutex, so I think this is a false positive. Nevertheless this re-arranges
the code a bit for more clarity, hoping that Coverity now can better track the
locks and unlocks. Also, the human reader might have to jump between routines a
bit less.

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