Skip to content

Commit

Permalink
Process.OSX: fix thread safety (#100260)
Browse files Browse the repository at this point in the history
Without this fix, it was possible for another thread to see an incorrect
(zero) value of s_timeBase_numer because of a race condition.
  • Loading branch information
ForNeVeR committed Mar 26, 2024
1 parent dc553fe commit 78a895f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ private static TimeSpan MapTime(ulong sysTime)
if (denom == default)
{
Interop.libSystem.mach_timebase_info_data_t timeBase = GetTimeBase();
s_timeBase_denom = denom = timeBase.denom;
s_timeBase_numer = timeBase.numer;
s_timeBase_denom = denom = timeBase.denom;
}
uint numer = s_timeBase_numer;

Expand Down

0 comments on commit 78a895f

Please sign in to comment.