summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Graham <julian@countyhell.(none)>2008-08-30 19:03:21 -0400
committerLudovic Courtès <ludo@gnu.org>2008-08-31 21:17:18 +0200
commit37a52039553b08c568e596852a871e59948ebfa6 (patch)
tree40c94a9c761d3aa9bd728dd855fb1be0347b05b4
parentd0b6ad349184773a3a7c515612858d84b5fd7f01 (diff)
downloadguile-37a52039553b08c568e596852a871e59948ebfa6.tar.gz
Resolve a deadlock caused by not checking mutex state after calling `SCM_TICK'.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--libguile/ChangeLog5
-rw-r--r--libguile/threads.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index e8d93628b..64229b235 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-29 Julian Graham <joolean@gmail.com>
+
+ * threads.c (fat_mutex_lock): Resolve a deadlock caused by not
+ checking mutex state after calling `SCM_TICK'.
+
2008-08-27 Ludovic Courtès <ludo@gnu.org>
Fix builds `--without-threads'. Reported by Han-Wen Nienhuys
diff --git a/libguile/threads.c b/libguile/threads.c
index 7e55f3b25..8699fd021 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;