We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6c6537 commit d2e8b15Copy full SHA for d2e8b15
erts/emulator/beam/erl_process.h
@@ -2942,9 +2942,14 @@ ERTS_GLB_INLINE
2942
Uint32 erts_sched_local_random(Uint additional_seed)
2943
{
2944
ErtsSchedulerData *esdp = erts_get_scheduler_data();
2945
- esdp->rand_state++;
2946
- return erts_sched_local_random_hash_64_to_32_shift(esdp->rand_state
2947
- + additional_seed);
+ if(ERTS_UNLIKELY(esdp == NULL))
+ return erts_sched_local_random_hash_64_to_32_shift(((Uint64)(UWord)&additional_seed)
+ + additional_seed);
2948
+ else {
2949
+ esdp->rand_state++;
2950
+ return erts_sched_local_random_hash_64_to_32_shift(esdp->rand_state
2951
2952
+ }
2953
}
2954
2955
#ifdef DEBUG
0 commit comments