1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fix a thread safety issue in TimeZoneInfo

This commit is contained in:
disarray2077 2021-06-21 17:06:33 -03:00
parent e61d702da1
commit 47a5785179

View file

@ -253,7 +253,10 @@ namespace System {
if (rule != null)
rule = rule.Clone();
oneYearLocFromUtc = new OffsetAndRule(year, currentYear.BaseUtcOffset, rule);
m_oneYearLocalFromUtc = oneYearLocFromUtc;
if (Interlocked.CompareExchange(ref m_oneYearLocalFromUtc, null, oneYearLocFromUtc) != null) {
delete oneYearLocFromUtc;
oneYearLocFromUtc = m_oneYearLocalFromUtc;
}
}
return oneYearLocFromUtc;
}