The branch, master has been updated via 9395d95 pthreadpool: Signal job completion without the pool mutex via e7e18c4 pthreadpool: We always want asserts to abort() via 0ea6ceb pthreadpool: Fix formatting from f4e25ec lib: Use tdb_storev in gencache
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 9395d958d6d5445082a369c54477e5f295df1974 Author: Volker Lendecke <v...@samba.org> Date: Mon Aug 29 11:35:39 2016 +0200 pthreadpool: Signal job completion without the pool mutex This essentially reverts 1c4284c7395f23. We now call an alien function from within pthreadpool, and we should not hold a mutex during that call. The alien function could (and pthreadpool_tevent_job_signal actually does) lock a mutex. We can't guarantee proper lock ordering here, so in theory we could deadlock. I haven't seen it in the wild yet, but I could imagine that both _parent pieces in pthreadpool and tevent could trigger such a deadlock. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Tue Aug 30 04:06:20 CEST 2016 on sn-devel-144 commit e7e18c432de41bb6f5a1a7b8c3d3bd245b9380df Author: Volker Lendecke <v...@samba.org> Date: Mon Aug 29 11:35:20 2016 +0200 pthreadpool: We always want asserts to abort() Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 0ea6cebd6132b762574c3a901dc3c61e3af13b73 Author: Volker Lendecke <v...@samba.org> Date: Fri Aug 26 11:34:02 2016 +0200 pthreadpool: Fix formatting Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/lib/pthreadpool/pthreadpool.c | 12 +++++++++--- source3/lib/pthreadpool/pthreadpool_tevent.c | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c index fc21d43..ee59cc4 100644 --- a/source3/lib/pthreadpool/pthreadpool.c +++ b/source3/lib/pthreadpool/pthreadpool.c @@ -23,6 +23,11 @@ #include "system/threads.h" #include "pthreadpool.h" #include "lib/util/dlinklist.h" + +#ifdef NDEBUG +#undef NDEBUG +#endif + #include <assert.h> struct pthreadpool_job { @@ -486,12 +491,13 @@ static void *pthreadpool_server(void *arg) job.fn(job.private_data); - res = pthread_mutex_lock(&pool->mutex); - assert(res == 0); - ret = pool->signal_fn(job.id, job.fn, job.private_data, pool->signal_fn_private_data); + + res = pthread_mutex_lock(&pool->mutex); + assert(res == 0); + if (ret != 0) { pthreadpool_server_exit(pool); pthread_mutex_unlock(&pool->mutex); diff --git a/source3/lib/pthreadpool/pthreadpool_tevent.c b/source3/lib/pthreadpool/pthreadpool_tevent.c index a66c36a..0b7a55a 100644 --- a/source3/lib/pthreadpool/pthreadpool_tevent.c +++ b/source3/lib/pthreadpool/pthreadpool_tevent.c @@ -96,7 +96,8 @@ static void pthreadpool_tevent_job_done(struct tevent_context *ctx, struct tevent_immediate *im, void *private_data); -static int pthreadpool_tevent_job_state_destructor(struct pthreadpool_tevent_job_state *state) +static int pthreadpool_tevent_job_state_destructor( + struct pthreadpool_tevent_job_state *state) { if (state->pool == NULL) { return 0; -- Samba Shared Repository