1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-04 08:40:21 +02:00

add atfork interface

* libguile/posix.h:
* libguile/posix.c (scm_c_atfork): New interface.
  (scm_fork): Wrap fork calls in atfork pre/post invocations, and
  finally a GC_call_with_alloc_lock.  It's an attempt to grab the
  interesting mutexes in Guile.

* libguile/weak-set.c (make_weak_set):
* libguile/weak-table.c (make_weak_table): Use atfork mechanism to lock
  and unlock weak sets and weak tables during a fork(), in such a way
  that does not prevent those tables from being gc'd.
This commit is contained in:
Andy Wingo 2012-02-08 15:47:22 +01:00
parent 981bace7e4
commit 9f6ac5d71d
6 changed files with 253 additions and 31 deletions

View file

@ -383,6 +383,7 @@ scm_i_init_guile (void *base)
scm_storage_prehistory ();
scm_threads_prehistory (base); /* requires storage_prehistory */
scm_weak_set_prehistory (); /* requires storage_prehistory */
scm_weak_table_prehistory (); /* requires storage_prehistory */
#ifdef GUILE_DEBUG_MALLOC
scm_debug_malloc_prehistory ();