summaryrefslogtreecommitdiff
path: root/main/data.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-02-28 18:15:34 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-02-28 18:15:34 +0000
commit2e834f7d36be6b7fd2531f4e4ac3dcbb050a2bdc (patch)
tree7a9ebd0ea02ff83ef870b1fa9377e5d334a57aea /main/data.c
parentbd7e9dae6663ab7f53213916fc001105b7e8bd94 (diff)
Astobj2 locking enhancement.
Add the ability to specify what kind of locking an ao2 object has when it is allocated. The locking could be one of: MUTEX, RWLOCK, or none. New API: ao2_t_alloc_options() ao2_alloc_options() ao2_t_container_alloc_options() ao2_container_alloc_options() ao2_rdlock() ao2_wrlock() ao2_tryrdlock() ao2_trywrlock() The OBJ_NOLOCK and AO2_ITERATOR_DONTLOCK flags have a slight meaning change. They no longer mean that the object is protected by an external mechanism. They mean the lock associated with the object has already been manually obtained by one of the ao2_lock calls. This change is necessary for RWLOCK support since they are not reentrant. Also an operation on an ao2 container may require promoting a read lock to a write lock by releasing the already held read lock to re-acquire as a write lock. Replaced API calls: ao2_t_link_nolock() ao2_link_nolock() ao2_t_unlink_nolock() ao2_unlink_nolock() with the respective ao2_t_link_flags() ao2_link_flags() ao2_t_unlink_flags() ao2_unlink_flags() API calls to be more flexible and to allow an anticipated enhancement to control linking duplicate objects into a container. The changes to format.c and format_cap.c are taking advantange of the new ao2 locking options to simplify the use of the format capabilities containers. Review: https://reviewboard.asterisk.org/r/1554/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/data.c')
0 files changed, 0 insertions, 0 deletions