summaryrefslogtreecommitdiffstats
path: root/lib/librthread/rthread_libc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librthread/rthread_libc.c')
-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 13df27c498e..018368a84dd 100644
--- a/lib/librthread/rthread_libc.c
+++ b/lib/librthread/rthread_libc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_libc.c,v 1.11 2013/06/01 20:47:40 tedu Exp $ */
+/* $OpenBSD: rthread_libc.c,v 1.12 2015/04/07 01:27:07 guenther 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> */
@@ -184,6 +184,23 @@ _thread_atexit_unlock(void)
}
/*
+ * atfork lock
+ */
+static struct _spinlock atfork_lock = _SPINLOCK_UNLOCKED;
+
+void
+_thread_atfork_lock(void)
+{
+ _spinlock(&atfork_lock);
+}
+
+void
+_thread_atfork_unlock(void)
+{
+ _spinunlock(&atfork_lock);
+}
+
+/*
* arc4random lock
*/
static struct _spinlock arc4_lock = _SPINLOCK_UNLOCKED;