Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jun 2004 19:59:15 GMT
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 55393 for review
Message-ID:  <200406201959.i5KJxFxT045105@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=55393

Change 55393 by julian@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) ====



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406201959.i5KJxFxT045105>