diff options
Diffstat (limited to 'libguile/threads.c')
-rw-r--r-- | libguile/threads.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libguile/threads.c b/libguile/threads.c index 64807f8c0..97d9f6497 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -484,6 +484,24 @@ static int thread_count; 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_thread *t; + + scm_i_pthread_mutex_lock (&thread_admin_mutex); + for (t = all_threads; t; t = t->next_thread) + if (SCM_I_DYNAMIC_STATE_P (t->dynamic_state)) + { + 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_i_pthread_mutex_unlock (&thread_admin_mutex); +} + /* Perform first stage of thread initialisation, in non-guile mode. */ static void |