mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
WIP
This commit is contained in:
parent
1d5cd9c626
commit
a964bb17ae
2 changed files with 10 additions and 4 deletions
10
runtime.c
10
runtime.c
|
@ -5341,14 +5341,18 @@ void *Cyc_init_thread(object thread_and_thunk)
|
||||||
thd->gc_args[0] = &Cyc_91end_91thread_67_primitive;
|
thd->gc_args[0] = &Cyc_91end_91thread_67_primitive;
|
||||||
thd->thread_id = pthread_self();
|
thd->thread_id = pthread_self();
|
||||||
|
|
||||||
// TODO: want to get thread params from calling thread, and probably
|
TODO: want to get thread params from calling thread, and probably
|
||||||
// allocate a new set of cells instead of just assigning this thread's
|
allocate a new set of cells instead of just assigning this thread's
|
||||||
// params to the parent's params.
|
params to the parent's params.
|
||||||
|
|
||||||
vector_type *t = (vector_type *)thd->scm_thread_obj;
|
vector_type *t = (vector_type *)thd->scm_thread_obj;
|
||||||
object op = Cyc_vector_ref(thd, t, obj_int2obj(2));
|
object op = Cyc_vector_ref(thd, t, obj_int2obj(2));
|
||||||
c_opaque_type *o = (c_opaque_type *)op;
|
c_opaque_type *o = (c_opaque_type *)op;
|
||||||
// thd->param_objs = ??
|
// thd->param_objs = ??
|
||||||
|
object obj = ((gc_thread_data *)o->ptr)->param_objs;
|
||||||
|
while (obj) {
|
||||||
|
|
||||||
|
}
|
||||||
// END TODO
|
// END TODO
|
||||||
|
|
||||||
gc_add_mutator(thd);
|
gc_add_mutator(thd);
|
||||||
|
|
|
@ -99,6 +99,8 @@
|
||||||
(thread-params (cons t (lambda ()
|
(thread-params (cons t (lambda ()
|
||||||
(vector-set! t 2 (%get-thread-data))
|
(vector-set! t 2 (%get-thread-data))
|
||||||
(thunk)))))
|
(thunk)))))
|
||||||
|
(vector-set! t 2 (%get-thread-data)) ;; Temporarily make parent thread
|
||||||
|
;; data available for child init
|
||||||
(Cyc-minor-gc)
|
(Cyc-minor-gc)
|
||||||
(Cyc-spawn-thread! thread-params)
|
(Cyc-spawn-thread! thread-params)
|
||||||
))
|
))
|
||||||
|
|
Loading…
Add table
Reference in a new issue