Add scoped locks to Asterisk.
authorMark Michelson <mmichelson@digium.com>
Tue, 21 Aug 2012 19:04:32 +0000 (19:04 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 21 Aug 2012 19:04:32 +0000 (19:04 +0000)
commit89a5ff859d4e6a66c813f5b240d8c9f6ddb119a3
tree9a6d125d64f7ff4c011b599218a22372ff8580bb
parentdb69da3667955373c06ebae66141c3cd42834fcc
Add scoped locks to Asterisk.

With the SCOPED_LOCK macro, you can create a variable
that locks a specific lock and unlocks the lock when the
variable goes out of scope. This is useful for situations
where many breaks, continues, returns, or other interruptions
would require separate unlock statements. With a scoped lock,
these aren't necessary.

There are specializations for mutexes, read locks, write locks,
ao2 locks, ao2 read locks, ao2 write locks, and channel locks.
Each of these is a SCOPED_LOCK at heart though.

Review: https://reviewboard.asterisk.org/r/2060

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/lock.h
main/config.c