Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Sep 2002 01:59:56 -0700 (PDT)
From:      Jonathan Mini <mini@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 16896 for review
Message-ID:  <200209010859.g818xuUZ037562@freefall.freebsd.org>

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

Change 16896 by mini@mini_stylus on 2002/09/01 01:59:23

	Save UTS context in kse_yield(2) and clear uc_busy, so that
	other upcall may take place later on.

Affected files ...

.. //depot/projects/kse/sys/kern/kern_proc.c#80 edit

Differences ...

==== //depot/projects/kse/sys/kern/kern_proc.c#80 (text+ko) ====

@@ -279,12 +279,29 @@
 int
 kse_yield(struct thread *td, struct kse_yield_args *uap)
 {
+	int error;
+	ucontext_t uc;
+	struct kse *ke;
 
+	/* Save UTS context. */
+	ke = td->td_kse;
+	if (ke == NULL)
+		return (EFAULT);
+	error = copyin(&ke->ke_mailbox->km_context, &uc, sizeof(ucontext_t));
+	if (error)
+		return (error);
+	thread_getcontext(td, &uc);
+	uc.uc_busy = 0;
+	error = copyout(&uc, &ke->ke_mailbox->km_context, sizeof(ucontext_t));
+	if (error)
+		return (error);
+
+	/* Abandon thread. */
 	PROC_LOCK(td->td_proc);
 	mtx_lock_spin(&sched_lock);
 	thread_exit();
 	/* NOTREACHED */
-	return(0);
+	return (0);
 }
 
 int kse_wakeup(struct thread *td, struct kse_wakeup_args *uap)

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?200209010859.g818xuUZ037562>