From b850b4760dddafa38d7850f86e99ce47326a2676 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 20 Nov 2009 19:19:51 +0000 Subject: Add an internal _once() method. This works identical to pthread_once(3) with the additional property that it is safe for routines in libc to use in both single-threaded and multi-threaded processes. Multi-threaded processes use the pthread_once() implementation from the threading library while single-threaded processes use a simplified "stub" version internal to libc. The libc stub-version of pthread_once() now also uses the simplified "stub" version as well instead of being a nop. Reviewed by: deischen, Matthew Fleming @ Isilon Suggested by: alc MFC after: 1 week --- lib/libc/gen/Makefile.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libc/gen/Makefile.inc') diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 0bdee9d..d6b403e 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -5,7 +5,8 @@ .PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen SRCS+= __getosreldate.c __xuname.c \ - _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \ + _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ + _thread_init.c \ alarm.c arc4random.c assert.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ -- cgit v1.1