[Top][All Lists]

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-47-g738c89

From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-47-g738c899
Date: Thu, 01 Dec 2011 11:59:18 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, stable-2.0 has been updated
       via  738c899e4c1ab9d25cfbcd1010f34e0cce400bca (commit)
      from  fd51e66190bde8cef74fec9725de4da3471901c4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 738c899e4c1ab9d25cfbcd1010f34e0cce400bca
Author: Andy Wingo <address@hidden>
Date:   Thu Dec 1 12:57:49 2011 +0100

    fix deadlock in before-gc-hook on certain 7.2alpha gc versions
    * libguile/gc.c (scm_init_gc): Only adjust gc frequency in the gc start
      hook if we know that it won't take a lock.


Summary of changes:
 libguile/gc.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/libguile/gc.c b/libguile/gc.c
index c03c239..ff1ebe6 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -1024,11 +1024,20 @@ scm_init_gc ()
-  scm_c_hook_add (&scm_before_gc_c_hook, adjust_gc_frequency, NULL, 0);
   scm_c_hook_add (&scm_before_gc_c_hook, queue_after_gc_hook, NULL, 0);
   scm_c_hook_add (&scm_before_gc_c_hook, start_gc_timer, NULL, 0);
   scm_c_hook_add (&scm_after_gc_c_hook, accumulate_gc_timer, NULL, 0);
+  /* GC_get_heap_usage does not take a lock, and so can run in the GC
+     start hook.  */
+  scm_c_hook_add (&scm_before_gc_c_hook, adjust_gc_frequency, NULL, 0);
+  /* GC_get_heap_usage might take a lock (and did from 7.2alpha1 to
+     7.2alpha7), so call it in the after_gc_hook.  */
+  scm_c_hook_add (&scm_after_gc_c_hook, adjust_gc_frequency, NULL, 0);
   GC_set_start_callback (run_before_gc_c_hook);

GNU Guile

reply via email to

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