summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_time_sup.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/erl_time_sup.c')
-rw-r--r--erts/emulator/beam/erl_time_sup.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c
index 0e1d4b087f..7af829e738 100644
--- a/erts/emulator/beam/erl_time_sup.c
+++ b/erts/emulator/beam/erl_time_sup.c
@@ -216,6 +216,15 @@ update_last_mtime(ErtsSchedulerData *esdp, ErtsMonotonicTime mtime)
if (!esdp)
esdp = erts_get_scheduler_data();
if (esdp) {
+#if 1
+ if (mtime < esdp->last_monotonic_time)
+ erts_exit(ERTS_ABORT_EXIT,
+ "Monotonic time stepped backwards!\n"
+ "Previous time: %b64d\n"
+ "Current time: %b64d\n",
+ esdp->last_monotonic_time,
+ mtime);
+#endif
ASSERT(mtime >= esdp->last_monotonic_time);
esdp->last_monotonic_time = mtime;
esdp->check_time_reds = 0;
@@ -1982,12 +1991,10 @@ send_time_offset_changed_notifications(void *new_offsetp)
for (mix = 0; mix < no_monitors; mix++) {
*patch_refp = to_mon_info[mix].ref;
- erts_proc_sig_send_persistent_monitor_msg(ERTS_MON_TYPE_TIME_OFFSET,
- *patch_refp,
- am_clock_service,
- to_mon_info[mix].pid,
- message_template,
- hsz);
+ erts_proc_sig_send_monitor_time_offset_msg(*patch_refp,
+ to_mon_info[mix].pid,
+ message_template,
+ hsz);
}
erts_free(ERTS_ALC_T_TMP, tmp);
@@ -2151,6 +2158,10 @@ time_unit_conversion(Process *c_p, Eterm term, ErtsMonotonicTime val, ErtsMonoto
/* Convert to common user specified time units */
switch (term) {
+ case am_native:
+ result = val + muloff*ERTS_MONOTONIC_OFFSET_NATIVE;
+ ERTS_BIF_PREP_RET(ret, make_time_val(c_p, result));
+ break;
case am_second:
case am_seconds:
case make_small(1):
@@ -2334,7 +2345,7 @@ erts_napi_convert_time_unit(ErtsMonotonicTime val, int from, int to)
{
ErtsMonotonicTime ffreq, tfreq, denom;
/*
- * Convertion between time units using floor function.
+ * Conversion between time units using floor function.
*
* Note that this needs to work also for negative
* values. Ordinary integer division on a negative
@@ -2434,7 +2445,7 @@ BIF_RETTYPE timestamp_0(BIF_ALIST_0)
/*
* Mega seconds is the only value that potentially
- * ever could be a bignum. However, that wont happen
+ * ever could be a bignum. However, that won't happen
* during at least the next 4 million years...
*
* (System time will also have wrapped in the