Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jun 2002 20:16:37 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 13301 for review
Message-ID:  <200206230316.g5N3Gbf17341@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=13301

Change 13301 by julian@julian_ref on 2002/06/22 20:15:41

	fix a sched-lock test and remove debugging Matt accidentally included.

Affected files ...

... //depot/projects/kse/sys/kern/kern_synch.c#69 edit

Differences ...

==== //depot/projects/kse/sys/kern/kern_synch.c#69 (text+ko) ====

@@ -421,7 +421,6 @@
  * flag the mutex is not entered before returning.
  */
 
-struct thread *TD1;
 
 int
 msleep(ident, mtx, priority, wmesg, timo)
@@ -458,7 +457,6 @@
 				and not the exiting thread. */
 		if ((p->p_flag & P_WEXIT) && catch && p->p_singlethread != td)
 			return (EINTR);
-		TD1 = NULL;
 		if (td->td_mailbox && (!(td->td_flags & TDF_INMSLEEP))) {
 			/*
 			 * If we have no queued work to do, then
@@ -466,17 +464,16 @@
 			 * We don't need to upcall now, just make it and
 			 * queue it.
 			 */
+			mtx_lock_spin(&sched_lock);
 			if (TAILQ_FIRST(&td->td_ksegrp->kg_runq) == NULL) {
-				TD1 = td;
 				/* Don't recurse here! */
-				mtx_lock_spin(&sched_lock);
 	KASSERT((td->td_kse->ke_state == KES_RUNNING), ("msleep: kse stateX?"));
 				td->td_flags |= TDF_INMSLEEP;
 				thread_schedule_upcall(td, td->td_kse);
 				td->td_flags &= ~TDF_INMSLEEP;
 	KASSERT((td->td_kse->ke_state == KES_RUNNING), ("msleep: kse stateY?"));
-				mtx_unlock_spin(&sched_lock);
 			}
+			mtx_unlock_spin(&sched_lock);
 		}
 		KASSERT((td->td_kse != NULL), ("msleep: NULL KSE2?"));
 		KASSERT((td->td_kse->ke_state == KES_RUNNING),

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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