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
This commit is contained in:
parent
2cf8fb9be3
commit
8feb1ea45e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user