mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
pthreadpool: fix helgrind error in pthreadpool_free()
We need to pthread_mutex_lock/unlock the pool mutex before we can destroy it. The following test would trigger this. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
c9f54db109
commit
f1dac71a86
@ -329,6 +329,11 @@ static int pthreadpool_free(struct pthreadpool *pool)
|
||||
ret = pthread_mutex_unlock(&pthreadpools_mutex);
|
||||
assert(ret == 0);
|
||||
|
||||
ret = pthread_mutex_lock(&pool->mutex);
|
||||
assert(ret == 0);
|
||||
ret = pthread_mutex_unlock(&pool->mutex);
|
||||
assert(ret == 0);
|
||||
|
||||
ret = pthread_mutex_destroy(&pool->mutex);
|
||||
ret1 = pthread_cond_destroy(&pool->condvar);
|
||||
ret2 = pthread_mutex_destroy(&pool->fork_mutex);
|
||||
|
Loading…
Reference in New Issue
Block a user