Bugzilla Bug 354593: checked in minor changes suggested by Nelson. r=nelson

This commit is contained in:
wtchang%redhat.com 2006-12-01 00:26:35 +00:00
Родитель ba5ef94fbd
Коммит 6794e0147b
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -547,7 +547,8 @@ PR_NormalizeTime(PRExplodedTime *time, PRTimeParamFn params)
extern struct tm *Maclocaltime(const time_t * t);
#endif
#define _PR_HAVE_LOCALTIME_MONITOR 1
#define HAVE_LOCALTIME_MONITOR 1 /* We use 'monitor' to serialize our calls
* to localtime(). */
static PRLock *monitor = NULL;
static struct tm *MT_safe_localtime(const time_t *clock, struct tm *result)
@ -604,16 +605,18 @@ static struct tm *MT_safe_localtime(const time_t *clock, struct tm *result)
void _PR_InitTime(void)
{
#ifdef _PR_HAVE_LOCALTIME_MONITOR
#ifdef HAVE_LOCALTIME_MONITOR
monitor = PR_NewLock();
#endif
}
void _PR_CleanupTime(void)
{
#ifdef _PR_HAVE_LOCALTIME_MONITOR
PR_DestroyLock(monitor);
monitor = NULL;
#ifdef HAVE_LOCALTIME_MONITOR
if (monitor) {
PR_DestroyLock(monitor);
monitor = NULL;
}
#endif
}