<p>Neels Hofmeyr <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/13121">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">add osmo_use_count API<br><br>Provide a common implementation of use counting that supports naming each user<br>as well as counting more than just one use per user, depending on the rules the<br>caller implies.<br><br>In osmo-msc, we were originally using a simple int counter to see whether a<br>connection is still in use or should be discarded. For clarity, we later added<br>names to each user in the form of a bitmask of flags, to figure out exactly<br>which users are still active: for logging and to debug double get / double put<br>bugs. This however is still not adequate, since there may be more than one CM<br>Service Request pending. Also, it is a specialized implementation that is not<br>re-usable.<br><br>With this generalized implementation, we can:<br><br>- fix the problem of inadequate counting of multiple concurrent CM Service<br>  Requests (more than one use count per user category),<br>- directly use arbitrary names for uses like __func__ or "foo" (no need to<br>  define enums and value_string[]s),<br>- re-use the same code for e.g. vlr_subscr and get fairly detailed VLR<br>  susbscriber usage logging for free.<br><br>Change-Id: Ife31e6798b4e728a23913179e346552a7dd338c0<br>---<br>M include/Makefile.am<br>A include/osmocom/core/use_count.h<br>M src/Makefile.am<br>A src/use_count.c<br>M tests/Makefile.am<br>M tests/testsuite.at<br>A tests/use_count/use_count_test.c<br>A tests/use_count/use_count_test.err<br>A tests/use_count/use_count_test.ok<br>9 files changed, 1,029 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/21/13121/4</pre><p>To view, visit <a href="https://gerrit.osmocom.org/13121">change 13121</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/13121"/><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: Ife31e6798b4e728a23913179e346552a7dd338c0 </div>
<div style="display:none"> Gerrit-Change-Number: 13121 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </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>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-CC: Max <msuraev@sysmocom.de> </div>