]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_sorcery_memory_cache.c: Fix deadlock with scheduler. 65/1365/1
authorRichard Mudgett <rmudgett@digium.com>
Wed, 30 Sep 2015 22:28:19 +0000 (17:28 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 1 Oct 2015 22:27:42 +0000 (17:27 -0500)
commit5d12653d2ad420bcad7a06321253a9a30d78363a
treec17fc2883ed3c526f12cf92ae10c2f84c0356d1d
parentb35b9a9e3202ff1b9cdde0704cb17d25fcf75821
res_sorcery_memory_cache.c: Fix deadlock with scheduler.

A deadlock can happen when a sorcery object is being expired from the
memory cache when at the same time another object is being placed into the
memory cache.  There are a couple other variations on this theme that
could cause the deadlock.  Basically if an object is being expired from
the sorcery memory cache at the same time as another thread tries to
update the next object expiration timer the deadlock can happen.

* Add a deadlock avoidance loop in expire_objects_from_cache() to check if
someone is trying to remove the scheduler callback from the scheduler.

ASTERISK-25441 #close

Change-Id: Iec7b0bdb81a72b39477727b1535b2539ad0cf4dc
res/res_sorcery_memory_cache.c