summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-01-15 01:19:58 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-01-15 01:19:58 +0000
commit2bffa8c7ba63face9a0759d932b37a9a92fa70e1 (patch)
treef99b450af0376398975de6925a35f0a19542cb8e
parent73502dd198e891d71deadd9c6112011c1e22bb19 (diff)
downloadFreeBSD-src-2bffa8c7ba63face9a0759d932b37a9a92fa70e1.zip
FreeBSD-src-2bffa8c7ba63face9a0759d932b37a9a92fa70e1.tar.gz
Also call sem_module_init in sem_close to initialize mutex
with some attributes.
-rw-r--r--lib/libc/gen/sem_new.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/gen/sem_new.c b/lib/libc/gen/sem_new.c
index 1ec39ba..f513973 100644
--- a/lib/libc/gen/sem_new.c
+++ b/lib/libc/gen/sem_new.c
@@ -255,6 +255,8 @@ _sem_close(sem_t *sem)
return (-1);
}
+ _pthread_once(&once, sem_module_init);
+
_pthread_mutex_lock(&sem_llock);
LIST_FOREACH(ni, &sem_list, next) {
if (sem == ni->sem) {
OpenPOWER on IntegriCloud