Allow optional thread cont arg

This commit is contained in:
Justin Ethier 2020-08-12 18:49:02 -04:00
parent 53b8644e5d
commit 10630b4907
2 changed files with 7 additions and 1 deletions

View file

@ -6624,7 +6624,11 @@ void *Cyc_init_thread(object thread_and_thunk)
thd->scm_thread_obj = car(thread_and_thunk);
thd->gc_cont = cdr(thread_and_thunk);
thd->gc_num_args = 1;
thd->gc_args[0] = &Cyc_91end_91thread_67_primitive;
if (t->num_elements >= 7 && t->elements[6] != boolean_f) {
thd->gc_args[0] = t->elements[6];
} else {
thd->gc_args[0] = &Cyc_91end_91thread_67_primitive;
}
thd->thread_id = pthread_self();
// Copy thread params from the calling thread

View file

@ -71,12 +71,14 @@
;; - name
;; - specific
;; - internal
;; - end of thread cont (or #f for default)
(vector
'cyc-thread-obj
thunk
(%alloc-thread-data) ;; Internal data for new thread
name-str
#f
#f
#f)))
(define (thread-name t) (vector-ref t 3))