aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2010-08-27 03:23:07 +0000
committerDavid Xu <davidxu@FreeBSD.org>2010-08-27 03:23:07 +0000
commit8e60ce996b14d8d41112ad374e3b2d6fc02b6823 (patch)
treefb1aeb8880e0ac391c0bcd9c9a3a3db3e465ca72 /lib
parent8733ff6e11836be5991e6b9b771c29cf198333f0 (diff)
downloadsrc-8e60ce996b14d8d41112ad374e3b2d6fc02b6823.tar.gz
src-8e60ce996b14d8d41112ad374e3b2d6fc02b6823.zip
clear lock to zero state if it is destroyed.
Notes
Notes: svn path=/head/; revision=211859
Diffstat (limited to 'lib')
-rw-r--r--lib/libthr/thread/thr_rtld.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c
index 2560a941d3a8..d9041adcfb90 100644
--- a/lib/libthr/thread/thr_rtld.c
+++ b/lib/libthr/thread/thr_rtld.c
@@ -81,8 +81,11 @@ static void
_thr_rtld_lock_destroy(void *lock)
{
int locki;
+ size_t i;
locki = (struct rtld_lock *)lock - &lock_place[0];
+ for (i = 0; i < sizeof(struct rtld_lock); ++i)
+ ((char *)lock)[i] = 0;
busy_places &= ~(1 << locki);
}