summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKurt Miller <kurt@cvs.openbsd.org>2008-01-23 02:20:25 +0000
committerKurt Miller <kurt@cvs.openbsd.org>2008-01-23 02:20:25 +0000
commit709c1fd3ff097ad9da48dddc3b87f1985d8c9fb1 (patch)
treee4436352127e18c93803970fcf1cecf7cbee2d4c /lib
parentc2d42fa5607288a1ad03b707ac53ea100cd5bb37 (diff)
- add missing libc locking functions for _thread_atexit_lock() and
_thread_atexit_unlock(). okay tedu@
Diffstat (limited to 'lib')
-rw-r--r--lib/librthread/rthread_libc.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/librthread/rthread_libc.c b/lib/librthread/rthread_libc.c
index da0d92f8da5..08458ad3b44 100644
--- a/lib/librthread/rthread_libc.c
+++ b/lib/librthread/rthread_libc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_libc.c,v 1.5 2008/01/01 00:43:39 kurt Exp $ */
+/* $OpenBSD: rthread_libc.c,v 1.6 2008/01/23 02:20:24 kurt Exp $ */
/* $snafu: libc_tag.c,v 1.4 2004/11/30 07:00:06 marc Exp $ */
/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
@@ -176,6 +176,23 @@ _thread_malloc_init(void)
}
/*
+ * atexit lock
+ */
+static _spinlock_lock_t atexit_lock = _SPINLOCK_UNLOCKED;
+
+void
+_thread_atexit_lock(void)
+{
+ _spinlock(&atexit_lock);
+}
+
+void
+_thread_atexit_unlock(void)
+{
+ _spinunlock(&atexit_lock);
+}
+
+/*
* arc4random lock
*/
static _spinlock_lock_t arc4_lock = _SPINLOCK_UNLOCKED;