wingo pushed a commit to branch wip-whippet
in repository guile.

commit 55dcadfc21b529af9b430fe82b438c557f1133d9
Author: Andy Wingo <wi...@pobox.com>
AuthorDate: Mon Jul 14 20:22:18 2025 +0200

    Inform GC before blocking
    
    * libguile/threads.c (block_self): Deactivate mutator around cond-wait.
---
 libguile/threads.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libguile/threads.c b/libguile/threads.c
index ee3e6cc63..93d5b9888 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -299,10 +299,12 @@ block_self (SCM queue, scm_i_pthread_mutex_t *mutex,
 
   t->block_asyncs++;
   q_handle = enqueue (queue, scm_thread_handle (t));
+  gc_deactivate (t->mutator);
   if (waittime == NULL)
     err = scm_i_scm_pthread_cond_wait (&t->sleep_cond, mutex);
   else
     err = scm_i_scm_pthread_cond_timedwait (&t->sleep_cond, mutex, waittime);
+  gc_reactivate (t->mutator);
 
   /* When we are still on QUEUE, we have been interrupted.  We
      report this only when no other error (such as a timeout) has

Reply via email to