<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16090">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">func_lock: Fix requesters counter in error paths.<br><br>In two places we bail out with failure after we've already incremented<br>the requesters counter, if this occured then it would effectively result<br>in unload to wait indefinitely, thus preventing clean shutdown.<br><br>Change-Id: I362a6c0dc424f736d4a9c733d818e72d19675283<br>Signed-off-by: Jaco Kroon <jaco@uls.co.za><br>---<br>M funcs/func_lock.c<br>1 file changed, 9 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/16090/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/funcs/func_lock.c b/funcs/func_lock.c</span><br><span>index 0726407..ad4d58e 100644</span><br><span>--- a/funcs/func_lock.c</span><br><span>+++ b/funcs/func_lock.c</span><br><span>@@ -268,7 +268,13 @@</span><br><span> </span><br><span> if (!clframe) {</span><br><span> if (unloading) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+ "Busy unloading. %sLOCK will fail.\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ trylock ? "TRY" : "");</span><br><span> /* Don't bother */</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_mutex_lock(¤t->mutex);</span><br><span style="color: hsl(120, 100%, 40%);">+ current->requesters--;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_mutex_unlock(¤t->mutex);</span><br><span> AST_LIST_UNLOCK(list);</span><br><span> return -1;</span><br><span> }</span><br><span>@@ -277,6 +283,9 @@</span><br><span> ast_log(LOG_ERROR,</span><br><span> "Unable to allocate channel lock frame. %sLOCK will fail.\n",</span><br><span> trylock ? "TRY" : "");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_mutex_lock(¤t->mutex);</span><br><span style="color: hsl(120, 100%, 40%);">+ current->requesters--;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_mutex_unlock(¤t->mutex);</span><br><span> AST_LIST_UNLOCK(list);</span><br><span> return -1;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16090">change 16090</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.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.asterisk.org/c/asterisk/+/16090"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I362a6c0dc424f736d4a9c733d818e72d19675283 </div>
<div style="display:none"> Gerrit-Change-Number: 16090 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-CC: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>