destroy_thread now processes guardian entries

original commit: 9bcf0a10c1a1c12d93a8eabb061821377de0934f
This commit is contained in:
Bob Burger 2017-04-12 10:26:03 -04:00
parent 06c7b53344
commit c19e662ed0
4 changed files with 35 additions and 0 deletions

2
LOG
View File

@ -438,3 +438,5 @@
of the same to the COMMAND-LINE OPTIONS section of the man page. of the same to the COMMAND-LINE OPTIONS section of the man page.
did a bit of minor cleanup elsewhere in the man page. did a bit of minor cleanup elsewhere in the man page.
use.stex, scheme.1.in use.stex, scheme.1.in
- destroy_thread now processes guardian entries
thread.c, 4.ms, release_notes.stex

View File

@ -172,6 +172,21 @@ static IBOOL destroy_thread(tc) ptr tc; {
/* process remembered set before dropping allocation area */ /* process remembered set before dropping allocation area */
S_scan_dirty((ptr **)EAP(tc), (ptr **)REAL_EAP(tc)); S_scan_dirty((ptr **)EAP(tc), (ptr **)REAL_EAP(tc));
/* process guardian entries */
{
ptr target, ges, obj, next; seginfo *si;
target = S_G.guardians[0];
for (ges = GUARDIANENTRIES(tc); ges != Snil; ges = next) {
obj = GUARDIANOBJ(ges);
next = GUARDIANNEXT(ges);
if (!IMMEDIATE(obj) && (si = MaybeSegInfo(ptr_get_segment(obj))) != NULL && si->generation != static_generation) {
INITGUARDIANNEXT(ges) = target;
target = ges;
}
}
S_G.guardians[0] = target;
}
/* deactivate thread */ /* deactivate thread */
if (ACTIVE(tc)) { if (ACTIVE(tc)) {
SETSYMVAL(S_G.active_threads_id, SETSYMVAL(S_G.active_threads_id,
@ -185,6 +200,7 @@ static IBOOL destroy_thread(tc) ptr tc; {
free((void *)THREADTC(thread)); free((void *)THREADTC(thread));
THREADTC(thread) = 0; /* mark it dead */ THREADTC(thread) = 0; /* mark it dead */
status = 1; status = 1;
break;
} }
ls = &Scdr(*ls); ls = &Scdr(*ls);
} }

View File

@ -2992,6 +2992,17 @@
(collect 0 0) (collect 0 0)
(list ((g1)) p))))) (list ((g1)) p)))))
'((c d) (b))) '((c d) (b)))
(or (not (threaded?))
(equal?
(parameterize ([collect-request-handler void])
(let ([g (make-guardian)])
(fork-thread (lambda () (g (list 'a 'b))))
(let f () (when (> #%$active-threads 1) (f)))
(collect)
(g)))
'(a b)))
(parameterize ([collect-request-handler void] [enable-object-counts #t]) (parameterize ([collect-request-handler void] [enable-object-counts #t])
(define-record-type fraz (fields zle)) (define-record-type fraz (fields zle))
(define g (make-guardian)) (define g (make-guardian))

View File

@ -1490,6 +1490,12 @@ in fasl files does not generally make sense.
%----------------------------------------------------------------------------- %-----------------------------------------------------------------------------
\section{Bug Fixes}\label{section:bugfixes} \section{Bug Fixes}\label{section:bugfixes}
\subsection{Missing guardian entries when a thread exits (9.4.1)}
A bug that causes guardian entries for a thread to be lost when a
thread exits has been fixed.
[This bug dated back to Version 6.5.]
\subsection{Incorrect code for certain nested \protect\scheme{if} patterns (9.4.1)} \subsection{Incorrect code for certain nested \protect\scheme{if} patterns (9.4.1)}
A bug in the source optimizer that produced incorrect code for certain A bug in the source optimizer that produced incorrect code for certain