Fix gc.test "after-gc-hook gets called" failures.
authorAndrea Azzarone <andrea.azzarone@canonical.com>
Thu, 11 Apr 2019 15:30:58 +0000 (16:30 +0100)
committerMark H Weaver <mhw@netris.org>
Tue, 16 Apr 2019 20:54:55 +0000 (16:54 -0400)
* 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

index 21b2a95296a52356977d93cf63249a9c6abcc41f..755e657eae508aabf18dc7db0544ff6adc493749 100644 (file)
@@ -174,6 +174,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;