<p>Richard Mudgett <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/8757">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip.c: Split ast_sip_push_task_synchronous() to fit expectations.<br><br>ast_sip_push_task_synchronous() did not necessarily execute the passed in<br>task under the specified serializer.  If the current thread is any<br>registered pjsip thread then it would execute the task immediately instead<br>of under the specified serializer.  Reentrancy issues could result if the<br>task does not execute with the right serializer.<br><br>The original reason ast_sip_push_task_synchronous() checked to see if the<br>current thread was a registered pjsip thread was because of a deadlock<br>with masquerades and the channel technology's fixup callback<br>(ASTERISK_22936).  A subsequent masquerade deadlock fix (ASTERISK_24356)<br>involving call pickups avoided the original deadlock situation entirely.<br>The PJSIP channel technology's fixup callback no longer needed to call<br>ast_sip_push_task_synchronous().<br><br>However, there are a few places where this unexpected behavior is still<br>required to avoid deadlocks.  The pjsip monitor thread executes callbacks<br>that do calls to ast_sip_push_task_synchronous() that would deadlock if<br>the task were actually pushed to the specified serializer.  I ran into one<br>dealing with the pubsub subscriptions where an ao2 destructor called<br>ast_sip_push_task_synchronous().<br><br>* Split ast_sip_push_task_synchronous() into<br>ast_sip_push_task_wait_servant() and ast_sip_push_task_wait_serializer().<br>ast_sip_push_task_wait_servant() has the old behavior of<br>ast_sip_push_task_synchronous().  ast_sip_push_task_wait_serializer() has<br>the new behavior where the task is always executed by the specified<br>serializer or a picked serializer if one is not passed in.  Both functions<br>behave the same if the current thread is not a SIP servant.<br><br>* Redirected ast_sip_push_task_synchronous() to<br>ast_sip_push_task_wait_servant() to preserve API for released branches.<br><br>ASTERISK_26806<br><br>Change-Id: Id040fa42c0e5972f4c8deef380921461d213b9f3<br>---<br>M channels/chan_pjsip.c<br>M channels/pjsip/dialplan_functions.c<br>M include/asterisk/res_pjsip.h<br>M res/res_pjsip.c<br>M res/res_pjsip/config_system.c<br>M res/res_pjsip/config_transport.c<br>M res/res_pjsip_header_funcs.c<br>M res/res_pjsip_history.c<br>M res/res_pjsip_outbound_publish.c<br>M res/res_pjsip_outbound_registration.c<br>M res/res_pjsip_pubsub.c<br>M res/res_pjsip_refer.c<br>M res/res_pjsip_transport_websocket.c<br>13 files changed, 185 insertions(+), 71 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/57/8757/3</pre><p>To view, visit <a href="https://gerrit.asterisk.org/8757">change 8757</a>. To unsubscribe, 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/8757"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: Id040fa42c0e5972f4c8deef380921461d213b9f3 </div>
<div style="display:none"> Gerrit-Change-Number: 8757 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>