summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_process.h
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2022-06-20 11:25:44 +0200
committerSverker Eriksson <sverker@erlang.org>2022-06-20 11:25:44 +0200
commitf225ebbc1a0b96609b042b39c1b82edd476c69cf (patch)
tree739b8a5917c8a36191016436cddf08be5004e5e4 /erts/emulator/beam/erl_process.h
parentee710b89fc302231ee65bd3b0155d80c6ce1d651 (diff)
parentfbc1c8ecd226a7d32ed81e107fcf3314ed5b0f90 (diff)
downloaderlang-f225ebbc1a0b96609b042b39c1b82edd476c69cf.tar.gz
Merge branch 'sverker/erts/ets-crash-dump-catree/OTP-18144' into maint
Diffstat (limited to 'erts/emulator/beam/erl_process.h')
-rw-r--r--erts/emulator/beam/erl_process.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h
index 1883a851ba..81958e373a 100644
--- a/erts/emulator/beam/erl_process.h
+++ b/erts/emulator/beam/erl_process.h
@@ -723,6 +723,7 @@ struct ErtsSchedulerData_ {
} pending_signal;
Uint64 reductions;
+ Uint64 rand_state;
ErtsSchedWallTime sched_wall_time;
ErtsGCInfo gc_info;
ErtsPortTaskHandle nosuspend_port_task_handle;
@@ -2884,19 +2885,15 @@ Uint32 erts_sched_local_random_hash_64_to_32_shift(Uint64 key)
/*
* This function attempts to return a random number based on the state
- * of the scheduler, the current process and the additional_seed
- * parameter.
+ * of the scheduler and the additional_seed parameter.
*/
ERTS_GLB_INLINE
Uint32 erts_sched_local_random(Uint additional_seed)
{
ErtsSchedulerData *esdp = erts_get_scheduler_data();
- Uint64 seed =
- additional_seed +
- esdp->reductions +
- esdp->current_process->fcalls +
- (((Uint64)esdp->no) << 32);
- return erts_sched_local_random_hash_64_to_32_shift(seed);
+ esdp->rand_state++;
+ return erts_sched_local_random_hash_64_to_32_shift(esdp->rand_state
+ + additional_seed);
}
#ifdef DEBUG