<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">I'm not in favor of this.  You currently don't need to care what<br>locking mechanism is on an object to lock/unlock it.  The only<br>exception is for recursively locking an object because rwlocks<br>are<br>not recursive.<br>> You could create the same type of object but with different<br>locking<br>mechanisms if you want.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">My idea is that the following should be an error:<br>void *obj = ao2_alloc_options(0, NULL, AO2_ALLOC_OPT_LOCK_NOLOCK);<br>ao2_lock(obj);</p><p style="white-space: pre-wrap; word-wrap: break-word;">If we explicitly disable locking for an object then later try to<br>lock the same object, it's likely a bug and we should either<br>re-enable locking for that object or stop trying to lock it.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">The point is that the particular code may not know the object even has a lock.</p><p style="white-space: pre-wrap; word-wrap: break-word;">IIRC There may still be frame format code that may or may not have a lock on the object.</p><p><a href="https://gerrit.asterisk.org/10376">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10376">change 10376</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/10376"/><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: comment </div>
<div style="display:none"> Gerrit-Change-Id: I5518e55739769792a76f766ce25880d7d944f63b </div>
<div style="display:none"> Gerrit-Change-Number: 10376 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 02 Oct 2018 19:32:33 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>