aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-04-27 15:42:58 +0200
committerRickard Green <[email protected]>2017-04-27 15:42:58 +0200
commit0a76c2bae9af8bf7fa9fc607686b78fbc5e4faba (patch)
tree79008031eae08d5a732359f7362521c8c7c24e4d /erts/emulator/beam
parente42a9ecec5f61af2bb3e8e1ea2884112bd4203c0 (diff)
parentbf2e5951dbd6398b71e32fd1cfb72b2870280280 (diff)
downloadotp-0a76c2bae9af8bf7fa9fc607686b78fbc5e4faba.tar.gz
otp-0a76c2bae9af8bf7fa9fc607686b78fbc5e4faba.tar.bz2
otp-0a76c2bae9af8bf7fa9fc607686b78fbc5e4faba.zip
Merge branch 'rickard/debug-timer-fix'
OTP-14356 * rickard/debug-timer-fix: Fix assert in dbg_verify_empty_later_slots()
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/time.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/erts/emulator/beam/time.c b/erts/emulator/beam/time.c
index cee3cb619f..a7e5a64b22 100644
--- a/erts/emulator/beam/time.c
+++ b/erts/emulator/beam/time.c
@@ -1364,21 +1364,29 @@ dbg_verify_empty_later_slots(ErtsTimerWheel *tiw, ErtsMonotonicTime to_pos)
tmp = to_pos;
tmp &= ERTS_TW_LATER_WHEEL_POS_MASK;
if (tmp > tiw->later.pos) {
+ ErtsMonotonicTime pos_min;
int slots;
tmp -= tiw->later.pos;
tmp /= ERTS_TW_LATER_WHEEL_SLOT_SIZE;
ERTS_TW_ASSERT(tmp > 0);
+
+ pos_min = tiw->later.pos;
+
if (tmp < (ErtsMonotonicTime) ERTS_TW_LATER_WHEEL_SIZE)
slots = (int) tmp;
- else
+ else {
+ pos_min += ((tmp / ERTS_TW_LATER_WHEEL_SIZE)
+ * ERTS_TW_LATER_WHEEL_SLOT_SIZE);
slots = ERTS_TW_LATER_WHEEL_SIZE;
+ }
while (slots > 0) {
ErtsTWheelTimer *tmr = tiw->w[ix];
+ pos_min += ERTS_TW_LATER_WHEEL_SLOT_SIZE;
if (tmr) {
ErtsTWheelTimer *end = tmr;
do {
- ERTS_TW_ASSERT(tmr->timeout_pos > to_pos);
+ ERTS_TW_ASSERT(tmr->timeout_pos >= pos_min);
tmr = tmr->next;
} while (tmr != end);
}