diff options
author | Andy Wingo <wingo@pobox.com> | 2016-10-31 22:37:46 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-10-31 22:37:46 +0100 |
commit | eeeee3297b8d4cb0717ee3b9ae5068b4f0b7f118 (patch) | |
tree | 8ffa02e98e442ba94d803768de8b48c2839b4cd4 /test-suite/tests/threads.test | |
parent | 94a3433b9d1da4acf2737aa1db8ce129b90623d9 (diff) | |
download | guile-eeeee3297b8d4cb0717ee3b9ae5068b4f0b7f118.tar.gz |
Remove thread cleanup facility
* NEWS: Add entry.
* doc/ref/api-scheduling.texi (Threads): Remove thread-cleanup docs.
* libguile/threads.c (guilify_self_1, do_thread_exit):
(scm_set_thread_cleanup_x, scm_thread_cleanup): Remove these.
* libguile/threads.h (scm_i_thread): Remove cleanup_handler.
* module/ice-9/threads.scm:
* module/ice-9/deprecated.scm (thread-cleanup, set-thread-cleanup!):
Remove.
* test-suite/tests/threads.test: Adapt to test cancel-thread return
values and not test thread-cleanup procs.
Diffstat (limited to 'test-suite/tests/threads.test')
-rw-r--r-- | test-suite/tests/threads.test | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/test-suite/tests/threads.test b/test-suite/tests/threads.test index 3b7a3e440..f489d5958 100644 --- a/test-suite/tests/threads.test +++ b/test-suite/tests/threads.test @@ -351,13 +351,12 @@ (join-thread t) #t))) - (pass-if "handler result passed to join" + (pass-if "cancel result passed to join" (require-cancel-thread) (let ((m (make-mutex))) (lock-mutex m) (let ((t (begin-thread (lock-mutex m)))) - (set-thread-cleanup! t (lambda () 'foo)) - (cancel-thread t) + (cancel-thread t 'foo) (eq? (join-thread t) 'foo)))) (pass-if "can cancel self" @@ -365,29 +364,9 @@ (let ((m (make-mutex))) (lock-mutex m) (let ((t (begin-thread (begin - (set-thread-cleanup! (current-thread) - (lambda () 'foo)) - (cancel-thread (current-thread)) + (cancel-thread (current-thread) 'foo) (lock-mutex m))))) - (eq? (join-thread t) 'foo)))) - - (pass-if "handler supplants final expr" - (let ((t (begin-thread (begin (set-thread-cleanup! (current-thread) - (lambda () 'bar)) - 'foo)))) - (eq? (join-thread t) 'bar))) - - (pass-if "remove handler by setting false" - (let ((m (make-mutex))) - (lock-mutex m) - (let ((t (begin-thread (lock-mutex m) 'bar))) - (set-thread-cleanup! t (lambda () 'foo)) - (set-thread-cleanup! t #f) - (unlock-mutex m) - (eq? (join-thread t) 'bar)))) - - (pass-if "initial handler is false" - (not (thread-cleanup (current-thread))))) + (eq? (join-thread t) 'foo))))) ;; ;; mutex ownership |