]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_sorcery_memory_cache.c: Fix deadlock with scheduler. 55/1355/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:25:37 +0000 (17:25 -0500)
commit40c69e78f571781b67a240554c119b870e3cd6d4
tree53c0bdc98119d06031b3dcf66c14ab80dca518f8
parentdfeb513e85d13550d81b40df5e95333c1ad5c61c
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