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:
parent
e61d702da1
commit
47a5785179
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue