From 13fcd175bc31b5df400dd518836bdce32f32206a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 17 Nov 2013 03:19:32 -0500 Subject: [PATCH 2/6] Block system asyncs while 'overrides_lock' is held. * libguile/procprop.c (scm_set_procedure_property_x): Block system asyncs while overrides_lock is held. Use dynwind block in case an exception is thrown. --- libguile/procprop.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libguile/procprop.c b/libguile/procprop.c index 36228d3..dae3ea7 100644 --- a/libguile/procprop.c +++ b/libguile/procprop.c @@ -229,7 +229,8 @@ SCM_DEFINE (scm_set_procedure_property_x, "set-procedure-property!", 3, 0, 0, SCM_MISC_ERROR ("arity is a deprecated read-only property", SCM_EOL); #endif - scm_i_pthread_mutex_lock (&overrides_lock); + scm_dynwind_begin (0); + scm_i_dynwind_pthread_mutex_lock_with_asyncs (&overrides_lock); props = scm_hashq_ref (overrides, proc, SCM_BOOL_F); if (scm_is_false (props)) { @@ -239,7 +240,7 @@ SCM_DEFINE (scm_set_procedure_property_x, "set-procedure-property!", 3, 0, 0, props = SCM_EOL; } scm_hashq_set_x (overrides, proc, scm_assq_set_x (props, key, val)); - scm_i_pthread_mutex_unlock (&overrides_lock); + scm_dynwind_end (); return SCM_UNSPECIFIED; } -- 1.7.5.4