mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
srfi-18: do a minor gc when terminating a thread
This ensures that any objects which are part of the thread context are transferred to the heap. Partial work towards addressing issue #534.
This commit is contained in:
parent
dd2b5c1174
commit
db6956e5aa
1 changed files with 4 additions and 1 deletions
|
@ -152,7 +152,9 @@
|
|||
(define (thread-terminate! t)
|
||||
(cond
|
||||
((and (thread? t) (Cyc-opaque? (vector-ref t 2)))
|
||||
(%thread-terminate! (vector-ref t 2)))
|
||||
(begin
|
||||
(Cyc-minor-gc)
|
||||
(%thread-terminate! (vector-ref t 2))))
|
||||
(else
|
||||
#f))) ;; TODO: raise an error instead?
|
||||
|
||||
|
@ -176,6 +178,7 @@
|
|||
(cond
|
||||
((and (thread? t) (Cyc-opaque? (vector-ref t 2)))
|
||||
(%thread-join! (vector-ref t 2))
|
||||
(Cyc-minor-gc)
|
||||
(vector-ref t 7))
|
||||
(else
|
||||
#f))) ;; TODO: raise an error instead?
|
||||
|
|
Loading…
Add table
Reference in a new issue