diff options
author | Rickard Green <[email protected]> | 2015-05-05 20:05:00 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-05-08 17:43:10 +0200 |
commit | 9c78f149517dc02457d4c59e90bc9b03d411e28c (patch) | |
tree | ea1d7d9f5bc0d58b07324f83535982de22b74646 /erts/emulator/beam/erl_thr_progress.c | |
parent | 7ba91b64862e29bfd579b04c73e2bccacde6a003 (diff) | |
download | otp-9c78f149517dc02457d4c59e90bc9b03d411e28c.tar.gz otp-9c78f149517dc02457d4c59e90bc9b03d411e28c.tar.bz2 otp-9c78f149517dc02457d4c59e90bc9b03d411e28c.zip |
Optimized timer implementation
Diffstat (limited to 'erts/emulator/beam/erl_thr_progress.c')
-rw-r--r-- | erts/emulator/beam/erl_thr_progress.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_thr_progress.c b/erts/emulator/beam/erl_thr_progress.c index 4c9b00d2ee..78e0964e8b 100644 --- a/erts/emulator/beam/erl_thr_progress.c +++ b/erts/emulator/beam/erl_thr_progress.c @@ -1360,6 +1360,7 @@ erts_thr_progress_fatal_error_wait(SWord timeout) { erts_aint32_t bc; SWord time_left = timeout; ErtsMonotonicTime timeout_time; + ErtsSchedulerData *esdp = erts_get_scheduler_data(); /* * Counting poll intervals may give us a too long timeout @@ -1367,7 +1368,7 @@ erts_thr_progress_fatal_error_wait(SWord timeout) { * this. In case we havn't got time correction this may * however fail too... */ - timeout_time = erts_get_monotonic_time(); + timeout_time = erts_get_monotonic_time(esdp); timeout_time += ERTS_MSEC_TO_MONOTONIC((ErtsMonotonicTime) timeout); while (1) { @@ -1378,7 +1379,7 @@ erts_thr_progress_fatal_error_wait(SWord timeout) { break; /* Succefully blocked all managed threads */ if (time_left <= 0) break; /* Timeout */ - if (timeout_time <= erts_get_monotonic_time()) + if (timeout_time <= erts_get_monotonic_time(esdp)) break; /* Timeout */ } } |