summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-07-31 10:13:10 +0200
committerMichael Adam <obnox@samba.org>2014-07-31 18:49:47 +0200
commita88f5a6da24ba6ffa15bc35b00fca85d23cd1216 (patch)
tree1cfa515c7e05e1ba5178bb00bb57d0cbb6f12213 /lib
parentb7f9d3b49160538d9d77723e80307cdfb2d071d0 (diff)
downloadsamba-a88f5a6da24ba6ffa15bc35b00fca85d23cd1216.tar.gz
uwrap: Add mutex in uwrap_destructor().
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/uid_wrapper/uid_wrapper.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c
index 742903a11d7..b77aa023ece 100644
--- a/lib/uid_wrapper/uid_wrapper.c
+++ b/lib/uid_wrapper/uid_wrapper.c
@@ -1162,6 +1162,7 @@ void uwrap_destructor(void)
{
struct uwrap_thread *u = uwrap.ids;
+ pthread_mutex_lock(&uwrap_id_mutex);
while (u != NULL) {
UWRAP_DLIST_REMOVE(uwrap.ids, u);
@@ -1170,6 +1171,7 @@ void uwrap_destructor(void)
u = uwrap.ids;
}
+ pthread_mutex_unlock(&uwrap_id_mutex);
if (uwrap.libc.handle != NULL) {
dlclose(uwrap.libc.handle);