[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 12/24: Remove fat mutex abandoned mutex error
From: |
Andy Wingo |
Subject: |
[Guile-commits] 12/24: Remove fat mutex abandoned mutex error |
Date: |
Sun, 6 Nov 2016 18:00:45 +0000 (UTC) |
wingo pushed a commit to branch master
in repository guile.
commit f1b7eaaa1a78f2a0b1be1f35ec583349322db02e
Author: Andy Wingo <address@hidden>
Date: Sat Nov 5 00:26:29 2016 +0100
Remove fat mutex abandoned mutex error
* libguile/threads.c (fat_mutex_lock): Remove abandoned mutex error, as
SRFI-18 is responsible for this.
* test-suite/tests/threads.test: Update test.
---
libguile/threads.c | 11 -----------
test-suite/tests/threads.test | 13 ++++---------
2 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/libguile/threads.c b/libguile/threads.c
index d15c4e7..6263519 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -1131,8 +1131,6 @@ SCM_DEFINE (scm_make_recursive_mutex,
"make-recursive-mutex", 0, 0, 0,
}
#undef FUNC_NAME
-SCM_SYMBOL (scm_abandoned_mutex_error_key, "abandoned-mutex-error");
-
static SCM
fat_mutex_lock (SCM mutex, scm_t_timespec *timeout, int *ret)
{
@@ -1154,15 +1152,6 @@ fat_mutex_lock (SCM mutex, scm_t_timespec *timeout, int
*ret)
*ret = 1;
break;
}
- else if (SCM_I_IS_THREAD (m->owner) && scm_c_thread_exited_p (m->owner))
- {
- m->owner = new_owner;
- err = scm_cons (scm_abandoned_mutex_error_key,
- scm_from_locale_string ("lock obtained on abandoned "
- "mutex"));
- *ret = 1;
- break;
- }
else if (scm_is_eq (m->owner, new_owner))
{
if (m->recursive)
diff --git a/test-suite/tests/threads.test b/test-suite/tests/threads.test
index ee6a505..2156f61 100644
--- a/test-suite/tests/threads.test
+++ b/test-suite/tests/threads.test
@@ -436,15 +436,10 @@
(lock-mutex m)
(lock-mutex m)))
- (pass-if "locking abandoned mutex throws exception"
- (let* ((m (make-mutex))
- (t (begin-thread (lock-mutex m)))
- (success #f))
- (join-thread t)
- (catch 'abandoned-mutex-error
- (lambda () (lock-mutex m))
- (lambda key (set! success #t)))
- success)))))
+ (pass-if "abandoned mutexes are dead"
+ (let* ((m (make-mutex)))
+ (join-thread (begin-thread (lock-mutex m)))
+ (not (lock-mutex m (+ (current-time) 0.1))))))))
;;
- [Guile-commits] branch master updated (fcc6a7b -> f8de980), Andy Wingo, 2016/11/06
- [Guile-commits] 04/24: Remove export srfi-18 never had, Andy Wingo, 2016/11/06
- [Guile-commits] 01/24: Fix typo in threads documentation, Andy Wingo, 2016/11/06
- [Guile-commits] 02/24: try-mutex in terms of mutex-lock, Andy Wingo, 2016/11/06
- [Guile-commits] 12/24: Remove fat mutex abandoned mutex error,
Andy Wingo <=
- [Guile-commits] 09/24: SRFI-18 manages own mutex "abandoned" state, Andy Wingo, 2016/11/06
- [Guile-commits] 05/24: srfi-18 condition variables disjoint, Andy Wingo, 2016/11/06
- [Guile-commits] 10/24: Remove thread-local weak mutex set, Andy Wingo, 2016/11/06
- [Guile-commits] 18/24: Back to simple unlock-mutex, Andy Wingo, 2016/11/06
- [Guile-commits] 08/24: Remove lock-mutex owner facility, Andy Wingo, 2016/11/06
- [Guile-commits] 14/24: SRFI-18 mutexes are not recursive, Andy Wingo, 2016/11/06
- [Guile-commits] 07/24: SRFI-18 threads disjoint from guile threads, Andy Wingo, 2016/11/06
- [Guile-commits] 21/24: scm_timed_lock_mutex replaces scm_lock_mutex_timed, Andy Wingo, 2016/11/06
- [Guile-commits] 15/24: Recursively locking a SRFI-18 mutex blocks, Andy Wingo, 2016/11/06
- [Guile-commits] 19/24: Separate fat mutex unlock and wait operations, Andy Wingo, 2016/11/06