]> git.ipfire.org Git - thirdparty/asterisk.git/commit
sched: ast_sched_del may return prematurely due to spurious wakeup 58/1158/1
authorJoshua Colp <jcolp@digium.com>
Sat, 29 Aug 2015 00:57:14 +0000 (21:57 -0300)
committerJoshua Colp <jcolp@digium.com>
Sat, 29 Aug 2015 01:04:38 +0000 (20:04 -0500)
commit06d42fede3a356c6e193345eab9d925b91c1e531
tree07f06b34182cd2b27ceac61889c9e495f59781bc
parent042ece7669538f7df4814475346734b40cc01e27
sched: ast_sched_del may return prematurely due to spurious wakeup

When deleting a scheduled item if the item in question is currently
executing the ast_sched_del function waits until it has completed.
This is accomplished using ast_cond_wait. Unfortunately the
ast_cond_wait function can suffer from spurious wakeups so the
predicate needs to be checked after it returns to make sure it has
really woken up as a result of being signaled.

This change adds a loop around the ast_cond_wait to make sure that
it only exits when the executing task has really completed.

ASTERISK-25355 #close

Change-Id: I51198270eb0b637c956c61aa409f46283432be61
main/sched.c