Merged revisions 91070 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Wed, 5 Dec 2007 01:59:32 +0000 (01:59 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 5 Dec 2007 01:59:32 +0000 (01:59 +0000)
commit5c56fa7fb73d51f676dc30ee8f0902925eddb548
tree183530632cf53a387dfb5cfcf866f6c833b0fd0f
parentec846d6cf29e35d7b072d575d604ec3572c2a892
Merged revisions 91070 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r91070 | russell | 2007-12-04 18:35:31 -0600 (Tue, 04 Dec 2007) | 11 lines

Fix some crashes in chan_iax2 that were reported as happening on Mac systems.
It turns out that the problem was the Mac version of the ast_atomic_fetchadd_int()
function.  The Mac atomic add function returns the _new_ value, while this function
is supposed to return the old value.  So, the crashes happened on unreferencing
objects.  If the reference count was decreased to 1, ao2_ref() thought that it
had been decreased to zero, and called the destructor.  However, there was still
an outstanding reference around.

(closes issue #11176)
(closes issue #11289)

........

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