diff options
author | Andy Wingo <wingo@pobox.com> | 2012-02-24 13:18:48 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-03-08 13:12:10 +0100 |
commit | f740445a9b5bf0a5e5090f0a2ddaffb2b803bab7 (patch) | |
tree | 0b52f7545433314fd41e83fcca8db5108fdfd87a /libguile/threads.c | |
parent | 75ba64d6797f5857cc9885eb753126119a8c8b68 (diff) | |
download | guile-f740445a9b5bf0a5e5090f0a2ddaffb2b803bab7.tar.gz |
run finalizers asynchronously in asyncs
* libguile/finalizers.c: New excitement! We'll be running finalizers
asynchronously, from asyncs. This will make it safer to allocate
while holding a mutex.
(GC_set_finalizer_notifier): Add back-compat shim.
* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
during boot.
* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
on demand.
(scm_gc): Explicitly run finalizers here.
* libguile/threads.c (guilify_self_2): Run finalizers here if
queue_finalizer_async happened to run during guilify_self_1.
* configure.ac: Add check for GC_set_finalizer_notifier.
Diffstat (limited to 'libguile/threads.c')
-rw-r--r-- | libguile/threads.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libguile/threads.c b/libguile/threads.c index 7944f4868..e8305b40d 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -620,6 +620,9 @@ guilify_self_2 (SCM parent) t->join_queue = make_queue (); t->block_asyncs = 0; + + /* See note in finalizers.c:queue_finalizer_async(). */ + GC_invoke_finalizers (); } |