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".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=9ec74a6a4e3d5b1d4b9eb23d1045aad2b0536e05 The branch, wip-nj-locks-nc has been created at 9ec74a6a4e3d5b1d4b9eb23d1045aad2b0536e05 (commit) - Log ----------------------------------------------------------------- commit 9ec74a6a4e3d5b1d4b9eb23d1045aad2b0536e05 Author: Neil Jerram <n...@ossau.uklinux.net> Date: Wed Mar 25 22:50:46 2009 +0000 Allow non-weak hash tables to be automatically thread-safe This patch allows a fat mutex to be associated with a hash table. When a hash table has an associated mutex, that mutex will be automatically locked and unlocked around all operations (include lookups) on the hash table's internal data. * libguile/hashtab.c (make_hash_table): Init mutex field to #f. (hashtable_mark): New function. (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x, scm_hash_fn_remove_x, scm_hash_clear_x, scm_internal_hash_fold, scm_internal_hash_for_each_handle): If the hash table has a mutex, lock and unlock it around all accessing of the hash table's internals. (scm_hash_use_mutex_x): New function. (scm_hashtab_prehistory): Use hashtable_mark as hash table mark function. * libguile/hashtab.h (SCM_HASHTABLE_MUTEX, SCM_SET_HASHTABLE_MUTEX, scm_hash_use_mutex_x): New declarations. (scm_t_hashtable): New mutex field. commit 10b11bab3317f72f74b59c1b5becf731215ae2f4 Author: Neil Jerram <n...@ossau.uklinux.net> Date: Wed Mar 25 22:34:23 2009 +0000 Make the interned symbols hash thread-safe These changes introduce a mutex that protects all accesses to and modifications of the symbols hash. They allow the test-define-race test to run without errors for a long time. (Well, for 200s anyway.) * libguile/environments.c (obarray_enter, obarray_replace): Extra parameter on scm_i_rehash calls. * libguile/hashtab.c: Include symbols.h. (scm_i_rehash): New mutex parameter. When non-NULL, unlock and relock this mutex around allocations, and recheck new size calculation (in case another thread has changed it). (rehash_after_gc): Special treatment for the symbol hash. (scm_hash_fn_create_handle_x, scm_hash_fn_remove_x): Extra parameter on scm_i_rehash calls. * libguile/hashtab.h (scm_i_rehash): New mutex parameter. * libguile/symbols.c (symbols): Rename scm_i_symbols and make non-static. (symbols_mutex): New variable. (scm_sys_symbols): symbols -> scm_i_symbols. (lookup_interned_symbol): Lock symbols_mutex while performing lookup. (intern_symbol): Add name, len and raw_hash parameters. Lock symbols_mutex while checking and modifying the symbols hash. Once the mutex is locked, recheck in case another thread has already interned the symbol. Return interned symbol, in order to tell callers about this last case. (scm_i_c_mem2symbol, scm_i_mem2symbol, scm_take_locale_symboln): Update intern_symbol calls. (scm_i_rehash_symbols_after_gc): New function. (scm_symbols_prehistory): symbols -> scm_i_symbols. Initialize symbols_mutex. * libguile/symbols.h (scm_i_symbols, scm_i_rehash_symbols_after_gc): New declarations. commit 1f2707cc9473548863b483fd12d97afe7d0c94c2 Author: Neil Jerram <n...@ossau.uklinux.net> Date: Wed Mar 25 20:55:37 2009 +0000 New test for thread-safe define Written by Linas Vepstas; modified by Neil Jerram. * test-suite/standalone/Makefile.am: Add test-define-race test. * test-suite/standalone/test-define-race.c: New test. ----------------------------------------------------------------------- hooks/post-receive -- GNU Guile