1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +02:00

Resolve a deadlock caused by not checking mutex state after calling `SCM_TICK'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Julian Graham 2008-09-06 20:06:17 -04:00 committed by Ludovic Courtès
parent 77554491e1
commit 1eb4952693
2 changed files with 6 additions and 1 deletions

View file

@ -1030,9 +1030,9 @@ fat_mutex_lock (SCM mutex)
{
while (1)
{
block_self (m->waiting, mutex, &m->lock, NULL);
if (scm_is_eq (m->owner, thread))
break;
block_self (m->waiting, mutex, &m->lock, NULL);
scm_i_pthread_mutex_unlock (&m->lock);
SCM_TICK;
scm_i_scm_pthread_mutex_lock (&m->lock);