diff options
author | Lars Thorsen <[email protected]> | 2015-05-08 12:41:17 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2015-05-08 12:41:17 +0200 |
commit | 4c1326cff025c3757260063ce2ebac7ab2d76378 (patch) | |
tree | 3ceb52fc14d5211b2b78786d2e2117f6942f2491 /lib/cosTransactions/src/ETraP_Common.erl | |
parent | 2e90dc9905de1e2817377fc2cfbd712ad8c802d0 (diff) | |
parent | 2a2d6181184ccde3bc929981eeee662203142238 (diff) | |
download | otp-4c1326cff025c3757260063ce2ebac7ab2d76378.tar.gz otp-4c1326cff025c3757260063ce2ebac7ab2d76378.tar.bz2 otp-4c1326cff025c3757260063ce2ebac7ab2d76378.zip |
Merge branch 'lars/remove_now/OTP-12687'
* lars/remove_now/OTP-12687:
[orber, cos*] Remove usage of erlang:now() in test suites
[orber] Use rand instead of random
[orber, cos*] Bump versions and update dependencies in app file
[orber, cos*] Remove usage of erlang:now()
Diffstat (limited to 'lib/cosTransactions/src/ETraP_Common.erl')
-rw-r--r-- | lib/cosTransactions/src/ETraP_Common.erl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/cosTransactions/src/ETraP_Common.erl b/lib/cosTransactions/src/ETraP_Common.erl index dd68e9b038..dca1c1aaa9 100644 --- a/lib/cosTransactions/src/ETraP_Common.erl +++ b/lib/cosTransactions/src/ETraP_Common.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2015. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -86,8 +86,9 @@ get_option(Key, OptionList, DefaultList) -> %%------------------------------------------------------------ create_name(Name,Type) -> - {MSec, Sec, USec} = erlang:now(), - lists:concat(['oe_',node(),'_',Type,'_',Name,'_',MSec, '_', Sec, '_', USec]). + Time = erlang:system_time(), + Unique = erlang:unique_integer([positive]), + lists:concat(['oe_',node(),'_',Type,'_',Name,'_',Time,'_',Unique]). %%------------------------------------------------------------ %% function : create_name/1 @@ -98,8 +99,9 @@ create_name(Name,Type) -> %%------------------------------------------------------------ create_name(Type) -> - {MSec, Sec, USec} = erlang:now(), - lists:concat(['oe_',node(),'_',Type,'_',MSec, '_', Sec, '_', USec]). + Time = erlang:system_time(), + Unique = erlang:unique_integer([positive]), + lists:concat(['oe_',node(),'_',Type,'_',Time,'_',Unique]). %%------------------------------------------------------------ %% function : try_timeout @@ -114,10 +116,9 @@ try_timeout(TimeoutAt) -> infinity -> false; _-> - {MegaSecs, Secs, _Microsecs} = erlang:now(), - Time = MegaSecs*1000000+Secs, + TimeSec = erlang:monotonic_time(seconds), if - Time < TimeoutAt -> + TimeSec < TimeoutAt -> false; true -> true |