diff options
author | Erlang/OTP <[email protected]> | 2010-01-25 13:48:58 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-01-25 13:48:58 +0000 |
commit | b2d471d1447981543549313f9fcfd4c37f4fbc80 (patch) | |
tree | ffdc1f08cfdecc6737fe67c9ad96833af6969aca /erts/emulator/beam/erl_time_sup.c | |
parent | 064ce3bdefa6ffa795c3ed5e7ceb7722664722d3 (diff) | |
parent | ed188cb4dbe90d3ebb4f7f251e04b5e8d2d3c143 (diff) | |
download | otp-b2d471d1447981543549313f9fcfd4c37f4fbc80.tar.gz otp-b2d471d1447981543549313f9fcfd4c37f4fbc80.tar.bz2 otp-b2d471d1447981543549313f9fcfd4c37f4fbc80.zip |
Merge branch 'ta/os_timestamp_no_mutex' into ccase/r13b04_dev
* ta/os_timestamp_no_mutex:
Remove mutex lock around sys_gettimeofday() in os:timestamp/0
OTP-8390 An unecessary lock operation in os:timestamp/0 has been
eliminated, making it slightly more efficient. (Thanks to Jonas
Falkevik and Tuncer Ayaz.)
Diffstat (limited to 'erts/emulator/beam/erl_time_sup.c')
-rw-r--r-- | erts/emulator/beam/erl_time_sup.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c index 76bfdecd9f..c15f85f8f1 100644 --- a/erts/emulator/beam/erl_time_sup.c +++ b/erts/emulator/beam/erl_time_sup.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1999-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1999-2010. 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 * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -754,12 +754,8 @@ get_sys_now(Uint* megasec, Uint* sec, Uint* microsec) { SysTimeval now; - erts_smp_mtx_lock(&erts_timeofday_mtx); - sys_gettimeofday(&now); - erts_smp_mtx_unlock(&erts_timeofday_mtx); - *megasec = (Uint) (now.tv_sec / 1000000); *sec = (Uint) (now.tv_sec % 1000000); *microsec = (Uint) (now.tv_usec); |