aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTuncer Ayaz <[email protected]>2010-01-23 00:16:26 +0100
committerBjörn Gustavsson <[email protected]>2010-01-23 10:19:02 +0100
commited188cb4dbe90d3ebb4f7f251e04b5e8d2d3c143 (patch)
tree593fcce707766d94875238ed2c11d828090df2c9
parente19d6e4463a9cc3b738fd32a46e0ce9282a70fd5 (diff)
downloadotp-ed188cb4dbe90d3ebb4f7f251e04b5e8d2d3c143.tar.gz
otp-ed188cb4dbe90d3ebb4f7f251e04b5e8d2d3c143.tar.bz2
otp-ed188cb4dbe90d3ebb4f7f251e04b5e8d2d3c143.zip
Remove mutex lock around sys_gettimeofday() in os:timestamp/0
In the erlang-questions thread "os:timestamp() uses mutex lock" Jonas Falkevik questioned the need for a mutex lock in os:timestamp/0. The mutex lock *is* needed in erlang:now() to guarantee the uniqueness of the returned time, but serves no useful purpose in os:timestamp(). Signed-off-by: Tuncer Ayaz <[email protected]>
-rw-r--r--erts/emulator/beam/erl_time_sup.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c
index 76bfdecd9f..28bbcc15ce 100644
--- a/erts/emulator/beam/erl_time_sup.c
+++ b/erts/emulator/beam/erl_time_sup.c
@@ -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);