diff options
author | Andy Wingo <wingo@pobox.com> | 2016-11-30 22:56:54 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-11-30 22:56:54 +0100 |
commit | a9dc553893dcd26f047afecc8dc84d30c9bdcde6 (patch) | |
tree | a77fd47425813e2b81be0e1fb18f76e7be942e7b /libguile/deprecated.h | |
parent | 8bd5dae8c372ffd5bd1866720acbddc2aa77cb65 (diff) |
Fix two wait-condition-variable race conditions
* libguile/threads.c (timed_wait): When looping to reacquire mutex,
check if mutex owner after dropping mutex to run asyncs when the
reacquire is interrupted.
Also for asyncs that interrupted the initial wait, just return #t
directly, and allow the caller to loop. Fixes a deadlock in which a
thread could have pending asyncs after dropping a mutex and which
prevent it from going to wait on a cond, but then the broadcast comes
while nobody is waiting and the mutex is dropped, then after
reacquiring the mutex when we go to wait again, we wait forever.
The correct thing to do is after reacquiring the mutex, to allow the
application to check if waiting is appropriate.
Diffstat (limited to 'libguile/deprecated.h')
0 files changed, 0 insertions, 0 deletions