aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-05-02 13:37:53 +0200
committerSverker Eriksson <[email protected]>2019-05-02 13:37:53 +0200
commite77fef6f36e2fbe79b14759642e9b5d498b55ec0 (patch)
treeb49c78d19cf93be3d74d38a6f0f5860104960b6e /erts
parent6939b6908c39b1a0a68f588cffcafc222a038bb9 (diff)
parent4d3a7b85af410122932401eeac8c1084fdfdb5ae (diff)
downloadotp-e77fef6f36e2fbe79b14759642e9b5d498b55ec0.tar.gz
otp-e77fef6f36e2fbe79b14759642e9b5d498b55ec0.tar.bz2
otp-e77fef6f36e2fbe79b14759642e9b5d498b55ec0.zip
Merge branch 'sverker/tw-assert'
* sverker/tw-assert: erts: Fix bug in timer wheel at cancel during bump yield erts: Tidy up some harmless code typos
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/time.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/erts/emulator/beam/time.c b/erts/emulator/beam/time.c
index a3069e419a..9eb020d070 100644
--- a/erts/emulator/beam/time.c
+++ b/erts/emulator/beam/time.c
@@ -316,7 +316,7 @@ struct ErtsTimerWheel_ {
#define ERTS_TW_SLOT_AT_ONCE (-1)
#define ERTS_TW_BUMP_LATER_WHEEL(TIW) \
- ((tiw)->pos + ERTS_TW_LATER_WHEEL_SLOT_SIZE >= (TIW)->later.pos)
+ ((TIW)->pos + ERTS_TW_LATER_WHEEL_SLOT_SIZE >= (TIW)->later.pos)
static int bump_later_wheel(ErtsTimerWheel *tiw, int *yield_count_p);
@@ -701,7 +701,8 @@ remove_timer(ErtsTimerWheel *tiw, ErtsTWheelTimer *p)
if (slot < ERTS_TW_SOON_WHEEL_END_SLOT) {
if (empty_slot
&& tiw->true_next_timeout_time
- && p->timeout_pos == tiw->next_timeout_pos) {
+ && p->timeout_pos == tiw->next_timeout_pos
+ && tiw->yield_slot == ERTS_TW_SLOT_INACTIVE) {
tiw->true_next_timeout_time = 0;
}
if (--tiw->soon.nto == 0)
@@ -714,7 +715,8 @@ remove_timer(ErtsTimerWheel *tiw, ErtsTWheelTimer *p)
ErtsMonotonicTime tpos = tiw->later.min_tpos;
tpos &= ERTS_TW_LATER_WHEEL_POS_MASK;
tpos -= ERTS_TW_LATER_WHEEL_SLOT_SIZE;
- if (tpos == tiw->next_timeout_pos)
+ if (tpos == tiw->next_timeout_pos
+ && tiw->yield_slot == ERTS_TW_SLOT_INACTIVE)
tiw->true_next_timeout_time = 0;
}
if (--tiw->later.nto == 0) {
@@ -908,7 +910,6 @@ erts_bump_timers(ErtsTimerWheel *tiw, ErtsMonotonicTime curr_time)
{
ErtsMonotonicTime tmp_slots = bump_to - tiw->pos;
- tmp_slots = (bump_to - tiw->pos);
if (tmp_slots < ERTS_TW_SOON_WHEEL_SIZE)
slots = (int) tmp_slots;
else