diff options
author | jhb <jhb@FreeBSD.org> | 2009-11-20 19:19:51 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-11-20 19:19:51 +0000 |
commit | b850b4760dddafa38d7850f86e99ce47326a2676 (patch) | |
tree | 9dcf60a4d7bd680a0877e1a8aa449c9766bdcc8f /lib/libc/gen/_pthread_stubs.c | |
parent | be8a54e0c3db12d3fecac288bf6ddfd350731d11 (diff) | |
download | FreeBSD-src-b850b4760dddafa38d7850f86e99ce47326a2676.zip FreeBSD-src-b850b4760dddafa38d7850f86e99ce47326a2676.tar.gz |
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
Diffstat (limited to 'lib/libc/gen/_pthread_stubs.c')
-rw-r--r-- | lib/libc/gen/_pthread_stubs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/_pthread_stubs.c b/lib/libc/gen/_pthread_stubs.c index 147235e..3b80e1d 100644 --- a/lib/libc/gen/_pthread_stubs.c +++ b/lib/libc/gen/_pthread_stubs.c @@ -105,7 +105,7 @@ pthread_func_entry_t __thr_jtable[PJT_MAX] = { {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_LOCK */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_TRYLOCK */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_UNLOCK */ - {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_ONCE */ + {PJT_DUAL_ENTRY(_libc_once)}, /* PJT_ONCE */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_DESTROY */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_INIT */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_RWLOCK_RDLOCK */ |