<p>Neels Hofmeyr <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/13143">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fsm: add osmo_fsm_inst_state_chg_keep_or_start_timer()<br><br>During FSM design for osmo-msc, I noticed that the current behavior that<br>keep_timer=true doesn't guarantee a running timer can make FSM design a bit<br>complex, especially when using osmo_tdef for timeout definitions.<br><br>A desirable keep_timer=true behavior is one that keeps the previous timer<br>running, but starts a timer if no timer is running yet.<br><br>The simplest example is: a given state repeatedly transitions back to itself,<br>but wants to set a timeout only on first entering, avoiding to restart the<br>timeout on re-entering.<br><br>Another example is a repeated transition between two or more states, where the<br>first time we enter this group a timeout should start, but it should not<br>restart from scratch on every transition.<br><br>When using osmo_tdef timeout definitions for this, so far separate meaningless<br>states have to be introduced that merely set a fixed timeout.<br><br>To simplify, add osmo_fsm_inst_state_chg_keep_or_start_timer(), and use this in<br>osmo_tdef_fsm_inst_state_chg() when both keep_timer == true *and* T != 0.<br><br>In tdef_test.ok, the changes show that on first entering state L, the previous<br>T=1 is now kept with a large remaining timeout. When entering state L from O,<br>where no timer was running, this time L's T123 is started.<br><br>Change-Id: Id647511a4b18e0c4de0e66fb1f35dc9adb9177db<br>---<br>M include/osmocom/core/fsm.h<br>M src/fsm.c<br>M src/tdef.c<br>M tests/tdef/tdef_test.ok<br>M tests/tdef/tdef_test_range_64bit.ok<br>5 files changed, 76 insertions(+), 17 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/13143/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/13143">change 13143</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/13143"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: Id647511a4b18e0c4de0e66fb1f35dc9adb9177db </div>
<div style="display:none"> Gerrit-Change-Number: 13143 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>