localtime.c (21659) | localtime.c (22315) |
---|---|
1/* 2** This file is in the public domain, so clarified as of 3** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov). 4*/ 5 6#ifndef lint 7#ifndef NOID 8static char elsieid[] = "@(#)localtime.c 7.57"; --- 1095 unchanged lines hidden (view full) --- 1104 pthread_mutex_lock(&localtime_mutex); 1105 if (localtime_key < 0) { 1106 if (pthread_key_create(&localtime_key, free) < 0) { 1107 pthread_mutex_unlock(&localtime_mutex); 1108 return(NULL); 1109 } 1110 } 1111 pthread_mutex_unlock(&localtime_mutex); | 1/* 2** This file is in the public domain, so clarified as of 3** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov). 4*/ 5 6#ifndef lint 7#ifndef NOID 8static char elsieid[] = "@(#)localtime.c 7.57"; --- 1095 unchanged lines hidden (view full) --- 1104 pthread_mutex_lock(&localtime_mutex); 1105 if (localtime_key < 0) { 1106 if (pthread_key_create(&localtime_key, free) < 0) { 1107 pthread_mutex_unlock(&localtime_mutex); 1108 return(NULL); 1109 } 1110 } 1111 pthread_mutex_unlock(&localtime_mutex); |
1112 if ((p_tm = pthread_getspecific(localtime_key)) != 0) { 1113 return(NULL); 1114 } else if (p_tm == NULL) { 1115 if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) { | 1112 p_tm = pthread_getspecific(localtime_key); 1113 if (p_tm == NULL) { 1114 if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) |
1116 return(NULL); | 1115 return(NULL); |
1117 } | |
1118 pthread_setspecific(localtime_key, p_tm); 1119 } 1120 pthread_mutex_lock(&lcl_mutex); 1121 tzset(); 1122 localsub(timep, 0L, p_tm); 1123 pthread_mutex_unlock(&lcl_mutex); 1124 return p_tm; 1125#else --- 631 unchanged lines hidden --- | 1116 pthread_setspecific(localtime_key, p_tm); 1117 } 1118 pthread_mutex_lock(&lcl_mutex); 1119 tzset(); 1120 localsub(timep, 0L, p_tm); 1121 pthread_mutex_unlock(&lcl_mutex); 1122 return p_tm; 1123#else --- 631 unchanged lines hidden --- |