[PATCH] libosmocore[master]: fsm: delete the timer when changing state

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Jul 10 13:15:57 UTC 2016


Review at  https://gerrit.osmocom.org/492

fsm: delete the timer when changing state

In osmo_fsm_inst_state_chg(), we need to stop any not-yet-expired timer
of the old state before transitioning into the new state.

Change-Id: I2558f9a7027a877ea8263785ed3c8d70d2513996
---
M src/fsm.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/492/1

diff --git a/src/fsm.c b/src/fsm.c
index 049663d..67db182 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -318,6 +318,9 @@
 		return -EPERM;
 	}
 
+	/* delete the old timer */
+	osmo_timer_del(&fi->timer);
+
 	if (st->onleave)
 		st->onleave(fi, new_state);
 

-- 
To view, visit https://gerrit.osmocom.org/492
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2558f9a7027a877ea8263785ed3c8d70d2513996
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list