cs: more clearing of a terminated thread
In particular, clear out the `suspend+resume-callbacks` field so that retaining the thread object does not retain those callbacks.
This commit is contained in:
parent
67595cc255
commit
c81228f31e
|
@ -129,9 +129,7 @@
|
||||||
|
|
||||||
[cpu-time #:mutable] ; accumulates CPU time in milliseconds
|
[cpu-time #:mutable] ; accumulates CPU time in milliseconds
|
||||||
|
|
||||||
[future #:mutable] ; current would-be future
|
[future #:mutable]) ; current would-be future
|
||||||
|
|
||||||
[condition-wakeup #:mutable])
|
|
||||||
#:authentic
|
#:authentic
|
||||||
#:property host:prop:unsafe-authentic-override #t ; allow evt chaperone
|
#:property host:prop:unsafe-authentic-override #t ; allow evt chaperone
|
||||||
#:property prop:waiter
|
#:property prop:waiter
|
||||||
|
@ -203,8 +201,6 @@
|
||||||
0 ; cpu-time
|
0 ; cpu-time
|
||||||
|
|
||||||
#f ; future
|
#f ; future
|
||||||
|
|
||||||
void ; condition-wakeup
|
|
||||||
))
|
))
|
||||||
((atomically
|
((atomically
|
||||||
(define cref (and c (custodian-register-thread c t remove-thread-custodian)))
|
(define cref (and c (custodian-register-thread c t remove-thread-custodian)))
|
||||||
|
@ -272,11 +268,14 @@
|
||||||
(thread-unscheduled-for-work-tracking! t))
|
(thread-unscheduled-for-work-tracking! t))
|
||||||
(remove-from-sleeping-threads! t)
|
(remove-from-sleeping-threads! t)
|
||||||
(run-kill-callbacks! t)
|
(run-kill-callbacks! t)
|
||||||
|
(set-thread-suspend+resume-callbacks! t null)
|
||||||
(when (thread-forward-break-to t)
|
(when (thread-forward-break-to t)
|
||||||
(do-break-thread (thread-forward-break-to t) 'break #f))
|
(do-break-thread (thread-forward-break-to t) 'break #f))
|
||||||
(for ([cr (in-list (thread-custodian-references t))])
|
(for ([cr (in-list (thread-custodian-references t))])
|
||||||
(unsafe-custodian-unregister t cr))
|
(unsafe-custodian-unregister t cr))
|
||||||
(set-thread-custodian-references! t null))
|
(set-thread-custodian-references! t null)
|
||||||
|
(set-thread-mailbox! t #f)
|
||||||
|
(set-thread-mailbox-wakeup! t void))
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
;; Thread termination
|
;; Thread termination
|
||||||
|
|
Loading…
Reference in New Issue
Block a user