Fix a bug in AST_SCHED_REPLACE_UNREF(). The reference count of the object
authorRussell Bryant <russell@russellbryant.com>
Thu, 30 Oct 2008 19:28:06 +0000 (19:28 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 30 Oct 2008 19:28:06 +0000 (19:28 +0000)
commit694dd34413854cc9704072c62ae63d3d6ce8d812
tree95e772cc264473ac062bfbd7e8969fd1241ee175
parentc0b9b259ca1b9121dab8210188a33933a5f9bede
Fix a bug in AST_SCHED_REPLACE_UNREF().  The reference count of the object
_must_ be increased before creating the scheduler entry.  Otherwise, you
create a race condition where the reference count may hit zero and the
object can disappear out from under you.  This could also would have
incorrectly decreased the reference count in the case that the scheduler
add failed.

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