Skip to content

Commit 78a895f

Browse files
authored
Process.OSX: fix thread safety (#100260)
Without this fix, it was possible for another thread to see an incorrect (zero) value of s_timeBase_numer because of a race condition.
1 parent dc553fe commit 78a895f

File tree

1 file changed

+1
-1
lines changed
  • src/libraries/System.Diagnostics.Process/src/System/Diagnostics

1 file changed

+1
-1
lines changed

src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.OSX.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ private static TimeSpan MapTime(ulong sysTime)
117117
if (denom == default)
118118
{
119119
Interop.libSystem.mach_timebase_info_data_t timeBase = GetTimeBase();
120-
s_timeBase_denom = denom = timeBase.denom;
121120
s_timeBase_numer = timeBase.numer;
121+
s_timeBase_denom = denom = timeBase.denom;
122122
}
123123
uint numer = s_timeBase_numer;
124124

0 commit comments

Comments
 (0)