diff options
author | Andy Wingo <wingo@pobox.com> | 2016-11-05 10:08:01 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-11-05 10:30:54 +0100 |
commit | f1f68fffb159d390a21e98dae364b1a425e33eb4 (patch) | |
tree | 0d4850053404c3f77fe584e8d15eb6b2edc502e9 /libguile | |
parent | b43f11469a859324d74fd9b7142b0f86e2f05d16 (diff) | |
download | guile-f1f68fffb159d390a21e98dae364b1a425e33eb4.tar.gz |
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.
Diffstat (limited to 'libguile')
-rw-r--r-- | libguile/threads.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libguile/threads.c b/libguile/threads.c index 6263519a0..b62c1639a 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -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) { |