Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/ld.elf_so Locking around dlclose()
details: https://anonhg.NetBSD.org/src/rev/69877bef9eb9
branches: trunk
changeset: 763603:69877bef9eb9
user: joerg <joerg%NetBSD.org@localhost>
date: Sun Mar 27 13:14:42 2011 +0000
description:
Locking around dlclose()
diffstat:
libexec/ld.elf_so/rtld.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diffs (47 lines):
diff -r 089641a6ab2f -r 69877bef9eb9 libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c Sun Mar 27 12:53:16 2011 +0000
+++ b/libexec/ld.elf_so/rtld.c Sun Mar 27 13:14:42 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld.c,v 1.142 2011/03/26 21:40:37 joerg Exp $ */
+/* $NetBSD: rtld.c,v 1.143 2011/03/27 13:14:42 joerg Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.142 2011/03/26 21:40:37 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.143 2011/03/27 13:14:42 joerg Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -839,10 +839,17 @@
int
dlclose(void *handle)
{
- Obj_Entry *root = _rtld_dlcheck(handle);
+ Obj_Entry *root;
+
+
+ _rtld_exclusive_enter();
- if (root == NULL)
+ root = _rtld_dlcheck(handle);
+
+ if (root == NULL) {
+ _rtld_exclusive_exit();
return -1;
+ }
_rtld_debug.r_state = RT_DELETE;
_rtld_debug_state();
@@ -853,6 +860,8 @@
_rtld_debug.r_state = RT_CONSISTENT;
_rtld_debug_state();
+ _rtld_exclusive_enter();
+
return 0;
}
Home |
Main Index |
Thread Index |
Old Index