1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 23:50:19 +02:00

Recursively locking a SRFI-18 mutex blocks

* libguile/threads.c (fat_mutex_lock): allow-external-unlock mutexes
  can't be recursive, but a recursive lock attempt can be unblocked by
  an external thread, so these mutexes shouldn't throw an error on
  recursive lock attempts.
* test-suite/tests/srfi-18.test: Add tests.
This commit is contained in:
Andy Wingo 2016-11-05 10:08:01 +01:00
parent b43f11469a
commit f1f68fffb1
2 changed files with 36 additions and 1 deletions

View file

@ -1152,7 +1152,7 @@ fat_mutex_lock (SCM mutex, scm_t_timespec *timeout, int *ret)
*ret = 1;
break;
}
else if (scm_is_eq (m->owner, new_owner))
else if (scm_is_eq (m->owner, new_owner) && !m->allow_external_unlock)
{
if (m->recursive)
{