From 12a5c7ca5e0bec9386ee24b2e2320d1aa03e55d5 Mon Sep 17 00:00:00 2001 From: Julian Graham Date: Sat, 30 Aug 2008 19:03:21 -0400 Subject: [PATCH] Resolve a deadlock caused by not checking mutex state after calling `SCM_TICK'. --- libguile/ChangeLog | 5 +++++ libguile/threads.c | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index e8d9362..40e2bb4 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2008-08-29 Julian Graham + + * threads.c (fat_mutex_lock): Resolve a deadlock caused by not + checking mutex state after calling `SCM_TICK'. + 2008-08-27 Ludovic Courtès Fix builds `--without-threads'. Reported by Han-Wen Nienhuys diff --git a/libguile/threads.c b/libguile/threads.c index 7e55f3b..8699fd0 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -1292,11 +1292,11 @@ fat_mutex_lock (SCM mutex, scm_t_timespec *timeout, SCM owner, int *ret) break; } } + block_self (m->waiting, mutex, &m->lock, timeout); scm_i_pthread_mutex_unlock (&m->lock); SCM_TICK; scm_i_scm_pthread_mutex_lock (&m->lock); } - block_self (m->waiting, mutex, &m->lock, timeout); } scm_i_pthread_mutex_unlock (&m->lock); return err; -- 1.5.4.3