chan_sip.c: Fix provisional_keepalive_sched_id deadlock.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 8 Mar 2016 00:28:58 +0000 (18:28 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 16 Mar 2016 19:44:51 +0000 (14:44 -0500)
commit67c79c326d3c0d1945a83622e490f226bc942a6d
treed2e6c10fcceb01c58135b55d04966284057d9437
parent76be7093cde121ef5fbf8033ef23c17718a44c94
chan_sip.c: Fix provisional_keepalive_sched_id deadlock.

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: I98a694fd42bc81436c83aa92de03226e6e4e3f48
channels/chan_sip.c