aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src/mnesia_lib.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-12-04 12:15:40 +0100
committerBjörn Gustavsson <[email protected]>2015-12-11 14:37:46 +0100
commit80757f9491c72ee262a5910e0b3b02e95b1e5f2a (patch)
tree1019a6da73ac28571a0b51727ed6fa33daf11522 /lib/mnesia/src/mnesia_lib.erl
parentdee396ffd32dcd68c47cab983c75ba32f921b9db (diff)
downloadotp-80757f9491c72ee262a5910e0b3b02e95b1e5f2a.tar.gz
otp-80757f9491c72ee262a5910e0b3b02e95b1e5f2a.tar.bz2
otp-80757f9491c72ee262a5910e0b3b02e95b1e5f2a.zip
Use 'rand' instead of the obsolete 'random' module
In most cases, we don't have to seed the random number generator, as the rand:uniform/1 takes care about that itself.
Diffstat (limited to 'lib/mnesia/src/mnesia_lib.erl')
-rw-r--r--lib/mnesia/src/mnesia_lib.erl15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/mnesia/src/mnesia_lib.erl b/lib/mnesia/src/mnesia_lib.erl
index 77c7a7638d..4e761d2bed 100644
--- a/lib/mnesia/src/mnesia_lib.erl
+++ b/lib/mnesia/src/mnesia_lib.erl
@@ -921,20 +921,7 @@ random_time(Retries, _Counter0) ->
UpperLimit = 500,
Dup = Retries * Retries,
MaxIntv = trunc(UpperLimit * (1-(50/((Dup)+50)))),
-
- case get(random_seed) of
- undefined ->
- _ = random:seed(erlang:unique_integer(),
- erlang:monotonic_time(),
- erlang:unique_integer()),
- Time = Dup + random:uniform(MaxIntv),
- %% dbg_out("---random_test rs ~w max ~w val ~w---~n", [Retries, MaxIntv, Time]),
- Time;
- _ ->
- Time = Dup + random:uniform(MaxIntv),
- %% dbg_out("---random_test rs ~w max ~w val ~w---~n", [Retries, MaxIntv, Time]),
- Time
- end.
+ Dup + rand:uniform(MaxIntv).
report_system_event(Event0) ->
Event = {mnesia_system_event, Event0},