diff options
author | Andy Wingo <wingo@pobox.com> | 2016-11-13 22:16:42 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-11-13 22:17:40 +0100 |
commit | 3f23688f397722546861d04688c3eefb0c9c9149 (patch) | |
tree | f618fc3eaa9d0083f285a5265a1127ffaf70cbdd | |
parent | 9ac2c9942b75d3e891ae8eabc219b68bfdf61f9c (diff) | |
download | guile-3f23688f397722546861d04688c3eefb0c9c9149.tar.gz |
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.
-rw-r--r-- | libguile/async.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libguile/async.c b/libguile/async.c index 174a87afb..92ed2f4d6 100644 --- a/libguile/async.c +++ b/libguile/async.c @@ -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) { |