run finalizers asynchronously (in asyncs and/or pthreads)
authorAndy Wingo <wingo@pobox.com>
Fri, 24 Feb 2012 12:18:48 +0000 (13:18 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 24 Feb 2012 12:33:02 +0000 (13:33 +0100)
commiteaf99988aecdcacd9204f61ba1d307584300f751
tree306ba2b7ec442d4a439a00c41e771340a6d8171e
parent415e00fc57e6d734d90b3a7e2324437ccdf406a7
run finalizers asynchronously (in asyncs and/or pthreads)

* libguile/finalizers.c: New excitement!  We'll be running finalizers in
  threads, if that's available.  If it's not available, during early
  boot, we can run finalizers in asyncs.  This will make it safer to
  allocate while holding a mutex.

* libguile/posix.c (scm_fork): Shut down the finalizer thread before
  forking.

* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
  during boot and, if available, initialialize the finalizer thread at
  the very end.

* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
  on demand.
  (scm_gc): Explicitly run finalizers here.  If you're calling this
  function, you probably want synchronous GC.
libguile/finalizers.c
libguile/finalizers.h
libguile/gc.c
libguile/init.c
libguile/posix.c