diff options
author | Andy Wingo <wingo@pobox.com> | 2011-11-23 12:13:12 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-11-23 12:53:38 +0100 |
commit | aafb4ed72414dd0dccc6ff27a59318adfda26abf (patch) | |
tree | bb02ba84034611d66207c33d6a1ebf78db798721 /libguile/threads.c | |
parent | adf8616fabbf3248cfbe4f075b5f2c02fed9e5c2 (diff) | |
download | guile-aafb4ed72414dd0dccc6ff27a59318adfda26abf.tar.gz |
optional default-value arg to make-fluid
* libguile/fluids.c (grow_dynamic_state, new_fluid): Arrange for the
default value in the dynamic-state vector to be SCM_UNDEFINED instead
of SCM_BOOL_F. If the value in the dynamic-state is #f, default to a
value attached to the fluid instead. This allows useful default
values.
(scm_make_fluid_with_default): New function, allows the user to
specify a default value for the fluid. Defaults to #f. Bound to
`make-fluid' on the Scheme side.
(scm_make_unbound_fluid): Use SCM_UNDEFINED as the default in all
threads.
(scm_fluid_unset_x): Also unset the default value. Not sure if this
is the right thing.
(fluid_ref): Update to the new default-value strategy.
* libguile/threads.c (scm_i_reset_fluid): Reset to SCM_UNDEFINED.
* libguile/threads.h: Remove extra arg to scm_i_reset_fluid.
* libguile/vm-i-system.c (fluid-ref): Update to new default-value
strategy.
* module/ice-9/vlist.scm (block-growth-factor): Default to 2 in all
threads. Fixes http://debbugs.gnu.org/10093.
Diffstat (limited to 'libguile/threads.c')
-rw-r--r-- | libguile/threads.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/threads.c b/libguile/threads.c index 752354008..e4d3e2181 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -478,7 +478,7 @@ static SCM scm_i_default_dynamic_state; /* Run when a fluid is collected. */ void -scm_i_reset_fluid (size_t n, SCM val) +scm_i_reset_fluid (size_t n) { scm_i_thread *t; @@ -489,7 +489,7 @@ scm_i_reset_fluid (size_t n, SCM val) SCM v = SCM_I_DYNAMIC_STATE_FLUIDS (t->dynamic_state); if (n < SCM_SIMPLE_VECTOR_LENGTH (v)) - SCM_SIMPLE_VECTOR_SET (v, n, val); + SCM_SIMPLE_VECTOR_SET (v, n, SCM_UNDEFINED); } scm_i_pthread_mutex_unlock (&thread_admin_mutex); } |