summaryrefslogtreecommitdiff
path: root/ice-9/safe.scm
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2009-03-25 22:50:46 +0000
committerNeil Jerram <neil@ossau.uklinux.net>2009-03-27 21:38:07 +0000
commit9ec74a6a4e3d5b1d4b9eb23d1045aad2b0536e05 (patch)
treeb51fd02b83fa92b8da310fb6cbcaa27386d32648 /ice-9/safe.scm
parent10b11bab3317f72f74b59c1b5becf731215ae2f4 (diff)
downloadguile-wip-nj-locks-nc.tar.gz
Allow non-weak hash tables to be automatically thread-safewip-nj-locks-nc
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.
Diffstat (limited to 'ice-9/safe.scm')
0 files changed, 0 insertions, 0 deletions