]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_sip.c: Fix waitid deadlock potential. 96/2396/3
authorRichard Mudgett <rmudgett@digium.com>
Wed, 9 Mar 2016 22:26:26 +0000 (16:26 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 16 Mar 2016 19:53:00 +0000 (14:53 -0500)
commite4ad55c888bc6c7e0d382e716d1d8ed4219d6cb2
tree7af5632120564c40320b852ecb2110ff402cdfdb
parent98d5669c280dbf5ffcd8a0431aa44e7f465fcefe
chan_sip.c: Fix waitid 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.

* Made always run check_pendings() under the scheduler thread so scheduler
ids can be checked safely.

ASTERISK-25023

Change-Id: Ia834d6edd5bdb47c163e4ecf884428a4a8b17d52
channels/chan_sip.c