diff options
author | jhb <jhb@FreeBSD.org> | 2010-01-06 20:43:40 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-01-06 20:43:40 +0000 |
commit | 52e7326f46b47766fdce0daed63d650df8e3e576 (patch) | |
tree | 5a4cfb0914c4e4b94a4b158a157513c7c389588b /lib/libc/stdtime | |
parent | 0b756fd13cb4f5b3b5e466f0185342059e2c8060 (diff) | |
download | FreeBSD-src-52e7326f46b47766fdce0daed63d650df8e3e576.zip FreeBSD-src-52e7326f46b47766fdce0daed63d650df8e3e576.tar.gz |
Use _pthread_once() rather than _once() for localtime() and gmtime(). These
methods are only invoked when __isthreaded is true at which point it is safe
to use _pthread_once() directly.
MFC after: 1 week
Diffstat (limited to 'lib/libc/stdtime')
-rw-r--r-- | lib/libc/stdtime/localtime.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c index ad26f7e..bee916b 100644 --- a/lib/libc/stdtime/localtime.c +++ b/lib/libc/stdtime/localtime.c @@ -1426,7 +1426,7 @@ const time_t * const timep; struct tm *p_tm; if (__isthreaded != 0) { - _once(&localtime_once, localtime_key_init); + _pthread_once(&localtime_once, localtime_key_init); if (localtime_key_error != 0) { errno = localtime_key_error; return(NULL); @@ -1527,7 +1527,7 @@ const time_t * const timep; struct tm *p_tm; if (__isthreaded != 0) { - _once(&gmtime_once, gmtime_key_init); + _pthread_once(&gmtime_once, gmtime_key_init); if (gmtime_key_error != 0) { errno = gmtime_key_error; return(NULL); |