1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

Fix crasher in scm_system_async_mark_for_thread

* libguile/async.c (scm_system_async_mark_for_thread): Only signal the
  cond if there is a wait mutex.
This commit is contained in:
Andy Wingo 2016-11-13 22:16:42 +01:00
parent 9ac2c9942b
commit 3f23688f39

View file

@ -148,9 +148,12 @@ SCM_DEFINE (scm_system_async_mark_for_thread, "system-async-mark", 1, 1, 0,
sleep_mutex locked while setting t->sleep_mutex and will only
unlock it again while waiting on sleep_cond.
*/
scm_i_scm_pthread_mutex_lock (wake->mutex);
scm_i_pthread_cond_signal (&t->sleep_cond);
scm_i_pthread_mutex_unlock (wake->mutex);
if (wake->mutex)
{
scm_i_scm_pthread_mutex_lock (wake->mutex);
scm_i_pthread_cond_signal (&t->sleep_cond);
scm_i_pthread_mutex_unlock (wake->mutex);
}
if (wake->fd >= 0)
{