]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_sip.c: Fix session timers deadlock potential. 10/2410/2
authorRichard Mudgett <rmudgett@digium.com>
Tue, 8 Mar 2016 21:08:19 +0000 (15:08 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 16 Mar 2016 19:44:51 +0000 (14:44 -0500)
commit02458cc6fdc76c3782e2d657f7d11bd866513efd
tree293a5947e2d3bfa908c9f9aab9df95c451c10547
parent69810b306df0f311acf550653e5ba9e2c24e2963
chan_sip.c: Fix session timers 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: I6d65269151ba95e0d8fe4e9e611881cde2ab4900
channels/chan_sip.c
channels/sip/include/sip.h