guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 46/55: Fix gc.test "after-gc-hook gets called" failures.


From: Andy Wingo
Subject: [Guile-commits] 46/55: Fix gc.test "after-gc-hook gets called" failures.
Date: Thu, 23 May 2019 11:52:44 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit fd4ba18bca1c6000fc0dd417a5b489e1ac60e0d9
Author: Andrea Azzarone <address@hidden>
Date:   Thu Apr 11 16:30:58 2019 +0100

    Fix gc.test "after-gc-hook gets called" failures.
    
    * libguile/scmsigs.c (signal_delivery_thread): Call scm_async_tick to
    give any pending asyncs a chance to run before we block indefinitely
    waiting for a signal to arrive.
---
 libguile/scmsigs.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index b4bd380..1583f4f 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -182,6 +182,14 @@ signal_delivery_thread (void *data)
     {
       struct signal_pipe_data sigdata;
 
+      /* This tick gives any pending asyncs a chance to run before we
+         block indefinitely waiting for a signal to arrive.  For example
+         it can happen that the garbage collector is triggered while
+         marking the signal handler for future execution.  Due to the
+         way the after-gc-hook is designed, without a call to
+         scm_async_tick, the after-gc-hook will not be triggered. */
+      scm_async_tick ();
+
       scm_without_guile (read_signal_pipe_data, &sigdata);
       
       sig = sigdata.sigbyte;



reply via email to

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