<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10968">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10968/1/res/res_pjsip_registrar.c">File res/res_pjsip_registrar.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10968/1/res/res_pjsip_registrar.c@343">Patch Set #1, Line 343:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">     if (!lock) {<br>          ao2_ref(monitor, -1);<br>         return 0;<br>     }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">We might want to clear the monitor->removing flag on failure here to potentially give removing another shot.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">if !lock then<br>  lock monitor<br>  removing = 0<br>  unlock monitor<br>  unref monitor<br>  return 0</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10968/1/res/res_pjsip_registrar.c@408">Patch Set #1, Line 408:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (ast_sip_push_task(NULL, register_contact_transport_remove_cb, monitor)) {<br>         ao2_ref(monitor, -1);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Maybe should hold the monitor lock until after pushing the task in case of failure.  Then you can clear the monitor->removing flag.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">lock monitor<br>if removing<br>   unlock monitor<br>   return</pre><p style="white-space: pre-wrap; word-wrap: break-word;">removing = 1</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ref monitor<br>if push_task<br>  removing = 0<br>  unref monitor<br>unlock monitor</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10968/1/res/res_pjsip_registrar.c@722">Patch Set #1, Line 722:</a> <code style="font-family:monospace,monospace">                                     + strlen(contact_name), NULL, AO2_ALLOC_OPT_LOCK_RWLOCK);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">You are not using the rwlock features.  You just need a mutex:<br>AO2_ALLOC_OPT_LOCK_MUTEX</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10968">change 10968</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/10968"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Iaa8e36e5311789549b76d8de42dfcea96013b2ed </div>
<div style="display:none"> Gerrit-Change-Number: 10968 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 07 Feb 2019 17:04:37 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>