chan_sip.c: Fix reinviteid deadlock potential.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 9 Mar 2016 22:34:53 +0000 (16:34 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 16 Mar 2016 19:44:51 +0000 (14:44 -0500)
commitc7fdff2e379c65413187433f9f4fac3f332fcf20
treefbdba90ac72ced2eafc6b482eb5d8f726e44514c
parentf484ddbdfe507f296d3fa7d733aac4a345147bb7
chan_sip.c: Fix reinviteid deadlock potential.

This patch is part of a series to resolve deadlocks in chan_sip.c.

Stopping a scheduled event can result in a deadlock if the scheduled event
is running when you try to stop the event.  If you hold a lock needed by
the scheduled event while trying to stop the scheduled event then a
deadlock can happen.  The general strategy for resolving the deadlock
potential is to push the actual starting and stopping of the scheduled
events off onto the scheduler/do_monitor() thread by scheduling an
immediate one shot scheduled event.  Some restructuring may be needed
because the code may assume that the start/stop of the scheduled events is
immediate.

ASTERISK-25023

Change-Id: I9c11b9d597468f63916c99e1dabff9f4a46f84c1
channels/chan_sip.c