From ee4858087b5073c4bf1d7069f105e74a7f03d8e7 Mon Sep 17 00:00:00 2001 From: Yorick Hardy Date: Sun, 12 Jan 2025 16:42:41 +0200 Subject: [PATCH] srfi-18: revert thread-terminate! changes These changes need to be revisited, and are not suitable for the threads garbage collection pull request. --- srfi/18.sld | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/srfi/18.sld b/srfi/18.sld index 11d46a28..1fb8b1f2 100644 --- a/srfi/18.sld +++ b/srfi/18.sld @@ -142,21 +142,9 @@ t)) (define (thread-yield!) (thread-sleep! 1)) - - (define-c %thread-terminate! - "(void *data, int argc, closure _, object k, object thread_data_opaque)" - " gc_thread_data *td = (gc_thread_data *)(opaque_ptr(thread_data_opaque)); - Cyc_end_thread(td); - /* TODO: if terminating the current thread, don't return */ - return_closcall1(data, k, boolean_t);") - (define (thread-terminate! t) - (cond - ((and (thread? t) (Cyc-opaque? (vector-ref t 2))) - (begin - (Cyc-minor-gc) - (%thread-terminate! (vector-ref t 2)))) - (else - #f))) ;; TODO: raise an error instead? + (define-c thread-terminate! + "(void *data, object _, int argc, object *args)" + " Cyc_end_thread(data); ") ;; TODO: not good enough, need to return value from thread ;; TODO: perhaps not an ideal solution using a loop/polling below, but good