git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299135
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
* the hash value on the argument.
*/
OBJ_CONTINUE = (1 << 4),
+ /*!
+ * \brief By using this flag, the ao2_container being searched will _NOT_
+ * be locked. Only use this flag if the ao2_container is being protected
+ * by another mechanism other that the internal ao2_lock.
+ */
+ OBJ_NOLOCK = (1 << 5),
};
/*!
last = i + 1;
}
- ao2_lock(c); /* avoid modifications to the content */
+
+ if (!(flags & OBJ_NOLOCK)) {
+ ao2_lock(c); /* avoid modifications to the content */
+ }
for (; i < last ; i++) {
/* scan the list with prev-cur pointers */
last = start;
}
}
- ao2_unlock(c);
+
+ if (!(flags & OBJ_NOLOCK)) {
+ ao2_unlock(c);
+ }
/* if multi_container was created, we are returning multiple objects */
if (multi_container != NULL) {