guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/01: Fix crasher in scm_system_async_mark_for_thread


From: Andy Wingo
Subject: [Guile-commits] 01/01: Fix crasher in scm_system_async_mark_for_thread
Date: Sun, 13 Nov 2016 21:32:29 +0000 (UTC)

wingo pushed a commit to branch master
in repository guile.

commit 3f23688f397722546861d04688c3eefb0c9c9149
Author: Andy Wingo <address@hidden>
Date:   Sun Nov 13 22:16:42 2016 +0100

    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.
---
 libguile/async.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libguile/async.c b/libguile/async.c
index 174a87a..92ed2f4 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)
         {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]