<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">looks a bit like a hack and rely on not-really-always-guaranteed-behavior.  I guess the cleaner way would be to tell the printing function to subtract one..</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I thought about that, but then also the 'show subscriber cache' iterates subscribers without get()ting them. And, since this is not multithreaded, there actually is no way how a subscriber can exist before this invocation and then be discarded by the put(). By definition we only find subscribers with a use count initially >= 1, and this count cannot decrease externally while the vty command is running. right?</p><p style="white-space: pre-wrap; word-wrap: break-word;">Instead, printing a use count that is not actually there is IMHO the hacky solution. Thinking if we might at some point add a used-by bitflag like for ran_conn, then we'd have to hack around in that, too...</p><p style="white-space: pre-wrap; word-wrap: break-word;">I guess the least hacky is to always get() and put() and expect a use count of 2 on the vty output. Yet ... the single-threaded-there-is-no-way-to-lose-the-vsub argument makes sense to me. Further opinions welcome...</p><p><a href="https://gerrit.osmocom.org/12266">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12266">change 12266</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/12266"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Id02b57b7ed299b010b9f8b9e809548eb1e6aa699 </div>
<div style="display:none"> Gerrit-Change-Number: 12266 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </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-CC: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 12 Dec 2018 11:33:01 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>