PERFORCE change 55393 for review
Julian Elischer
julian at FreeBSD.org
Sun Jun 20 19:59:22 GMT 2004
http://perforce.freebsd.org/chv.cgi?CH=55393
Change 55393 by julian at julian_desk on 2004/06/20 19:59:07
Set teh "had threads" flag down when doign exec or exit,
and ensure everything actually looks that way.
{this chamge still not tested}.
Affected files ...
.. //depot/projects/nsched/sys/kern/kern_exec.c#5 edit
.. //depot/projects/nsched/sys/kern/kern_exit.c#10 edit
.. //depot/projects/nsched/sys/kern/kern_fork.c#5 edit
.. //depot/projects/nsched/sys/kern/kern_kse.c#14 edit
Differences ...
==== //depot/projects/nsched/sys/kern/kern_exec.c#5 (text+ko) ====
@@ -263,8 +263,14 @@
/*
* If we get here all other threads are dead,
* so unset the associated flags and lose KSE mode.
+ * This meams that we must get rid of any extra
+ * upcalls and kses we may have picked up along the way.
*/
- p->p_flag &= ~P_SA;
+ mtx_lock_spin(&sched_lock):
+ sched_set_concurrancy(td, 1);
+ upcall_remove(td);
+ mtx_unlock_spin(&sched_lock):
+ p->p_flag &= ~(P_SA|P_HADTHREADS);
td->td_mailbox = NULL;
td->td_pflags &= ~TDP_SA;
thread_single_end();
==== //depot/projects/nsched/sys/kern/kern_exit.c#10 (text+ko) ====
@@ -167,9 +167,14 @@
* ...
* Turn off threading support.
*/
- p->p_flag &= ~P_SA;
+ mtx_lock_spin(&sched_lock):
+ sched_set_concurrancy(td, 1);
+ upcall_remove(td);
+ mtx_unlock_spin(&sched_lock):
+ p->p_flag &= ~(P_SA|P_HADTHREADS);
+ td->td_mailbox = NULL;
td->td_pflags &= ~TDP_SA;
- thread_single_end(); /* end single-threading mode */
+ thread_single_end();
}
p->p_flag |= P_WEXIT;
==== //depot/projects/nsched/sys/kern/kern_fork.c#5 (text+ko) ====
==== //depot/projects/nsched/sys/kern/kern_kse.c#14 (text+ko) ====
More information about the p4-projects
mailing list