Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Apr 2004 02:11:09 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 50825 for review
Message-ID:  <200404110911.i3B9B9sa014848@repoman.freebsd.org>

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

Change 50825 by julian@julian_jules1 on 2004/04/11 02:10:23

	 tweek tweek

Affected files ...

.. //depot/projects/nsched/sys/kern/kern_thread.c#7 edit

Differences ...

==== //depot/projects/nsched/sys/kern/kern_thread.c#7 (text+ko) ====

@@ -1262,6 +1262,7 @@
 		td->td_standin = NULL;
 	}
 
+	/* drop FPU & debug register state */
 	cpu_thread_exit(td);	/* XXXSMP */
 	/*
 	 * The last thread is left attached to the process
@@ -1440,6 +1441,8 @@
 	if (spare == NULL) {
 		spare = thread_alloc();
 		spare->td_tid = thread_new_tid();
+	} else {
+		sched_init_thread(spare);
 	}
 	td->td_standin = spare;
 	bzero(&spare->td_startzero,
@@ -1476,8 +1479,7 @@
 	bcopy(&td->td_startcopy, &td2->td_startcopy,
 	    (unsigned) RANGEOF(struct thread, td_startcopy, td_endcopy));
 	thread_link(td2, ku->ku_ksegrp);
-	sched_init_thread(td2);
-	/* inherit blocked thread's context */
+	/* inherit parts of blocked thread's context as a good template */
 	cpu_set_upcall(td2, td);
 	/* Let the new thread become owner of the upcall */
 	ku->ku_owner   = td2;
@@ -1488,7 +1490,6 @@
 	td2->td_inhibitors = 0;
 	SIGFILLSET(td2->td_sigmask);
 	SIG_CANTMASK(td2->td_sigmask);
-	sched_init_thread(td2);
 	sched_fork_thread(td, td2);
 	return (td2);	/* bogus.. should be a void function */
 }



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