quiet TSAN in serverLog

Former-commit-id: a836d5947d5a024d855bf5d0d6269e014e47b868
This commit is contained in:
John Sully 2020-04-16 17:06:25 -04:00
parent e177cdcd3c
commit fe307bb1b1

View File

@ -1077,7 +1077,9 @@ void serverLogRaw(int level, const char *msg) {
gettimeofday(&tv,NULL);
struct tm tm;
nolocks_localtime(&tm,tv.tv_sec,g_pserver->timezone,g_pserver->daylight_active);
int daylight_active;
__atomic_load(&g_pserver->daylight_active, &daylight_active, __ATOMIC_RELAXED);
nolocks_localtime(&tm,tv.tv_sec,g_pserver->timezone,daylight_active);
off = strftime(buf,sizeof(buf),"%d %b %Y %H:%M:%S.",&tm);
snprintf(buf+off,sizeof(buf)-off,"%03d",(int)tv.tv_usec/1000);
if (g_pserver->sentinel_mode) {
@ -1777,7 +1779,7 @@ void updateCachedTime(int update_daylight_info) {
struct tm tm;
time_t ut = g_pserver->unixtime;
localtime_r(&ut,&tm);
g_pserver->daylight_active = tm.tm_isdst;
__atomic_store(&g_pserver->daylight_active, &tm.tm_isdst, __ATOMIC_RELAXED);
}
}