Skip to content

Commit 0549417

Browse files
authored
Use minipal_hires_ticks() as random seed (dotnet#118362)
minipal_hires_ticks is much more likely to guarantee that different threads end up with different seeds
1 parent 56b2a2a commit 0549417

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/nativeaot/Runtime/thread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static Thread* g_RuntimeInitializingThread;
3838

3939
ee_alloc_context::PerThreadRandom::PerThreadRandom()
4040
{
41-
minipal_xoshiro128pp_init(&random_state, (uint32_t)minipal_lowres_ticks());
41+
minipal_xoshiro128pp_init(&random_state, (uint32_t)minipal_hires_ticks());
4242
}
4343

4444
thread_local ee_alloc_context::PerThreadRandom ee_alloc_context::t_random = PerThreadRandom();

0 commit comments

Comments
 (0)