<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1820/">https://reviewboard.asterisk.org/r/1820/</a>
     </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers and Mark Michelson.</div>
<div>By rmudgett.</div>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This is the trunk version of the https://reviewboard.asterisk.org/r/1818/ patch.  It fixes the concern Mark Michelson brought up about non-determinism.  Since it requires an API change to fix it, it can only be done on trunk.

Steps to invoke the deadlock:
1) Invoke an AMI Command action such as &quot;dialplan reload&quot; or &quot;originate&quot;.
2) The command then causes an external script to request another AMI Command action.
3) Deadlock because the current code only allows each registered AMI action to have one active instance at a time.

This patch avoids the deadlock and tries to keep a module unload from potentially causing a crash by an active AMI action using that module.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Code inspection says it should work and the compiler agrees. :)

I also loaded Asterisk to make sure it can still load because ast_manager_register_xml() can only be used on modules that are loadable.  You must use ast_manager_register_xml_core() on non-loadable modules that are part of Asterisk&#39;s core.  If you use ast_manager_register_xml() when you should use ast_manager_register_core(), you will crash on load.  If you mix them up the other way, you run the risk of crashing on unload that the additional changes on trunk are to avoid.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-19487">ASTERISK-19487</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/include/asterisk/manager.h <span style="color: grey">(359942)</span></li>

 <li>/trunk/main/data.c <span style="color: grey">(359942)</span></li>

 <li>/trunk/main/db.c <span style="color: grey">(359942)</span></li>

 <li>/trunk/main/features.c <span style="color: grey">(359942)</span></li>

 <li>/trunk/main/manager.c <span style="color: grey">(359942)</span></li>

 <li>/trunk/main/pbx.c <span style="color: grey">(359942)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1820/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>




  </div>
 </body>
</html>