Module Name:    src
Committed By:   pooka
Date:           Mon Nov  9 19:00:52 UTC 2009

Modified Files:
        src/sys/rump/librump/rumpkern: threads.c

Log Message:
set LP_INTR for KTHREAD_INTR


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpkern/threads.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpkern/threads.c
diff -u src/sys/rump/librump/rumpkern/threads.c:1.1 src/sys/rump/librump/rumpkern/threads.c:1.2
--- src/sys/rump/librump/rumpkern/threads.c:1.1	Wed Nov  4 19:17:53 2009
+++ src/sys/rump/librump/rumpkern/threads.c	Mon Nov  9 19:00:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: threads.c,v 1.1 2009/11/04 19:17:53 pooka Exp $	*/
+/*	$NetBSD: threads.c,v 1.2 2009/11/09 19:00:52 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2009 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: threads.c,v 1.1 2009/11/04 19:17:53 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: threads.c,v 1.2 2009/11/09 19:00:52 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -52,16 +52,18 @@
 threadbouncer(void *arg)
 {
 	struct kthdesc *k = arg;
+	struct lwp *l = k->mylwp;
 	void (*f)(void *);
 	void *thrarg;
 
 	/* schedule ourselves first */
 	f = k->f;
 	thrarg = k->arg;
-	rumpuser_set_curlwp(k->mylwp);
+	rumpuser_free(k);
+
+	rumpuser_set_curlwp(l);
 	rump_schedule();
 
-	kmem_free(k, sizeof(struct kthdesc));
 	if ((curlwp->l_pflag & LP_MPSAFE) == 0)
 		KERNEL_LOCK(1, NULL);
 
@@ -125,12 +127,14 @@
 	if (ci != NULL)
 		panic("%s: bounded threads not supported", __func__);
 
-	k = kmem_alloc(sizeof(struct kthdesc), KM_SLEEP);
+	k = rumpuser_malloc(sizeof(struct kthdesc), 0);
 	k->f = func;
 	k->arg = arg;
 	k->mylwp = l = rump_lwp_alloc(0, rump_nextlid());
 	if (flags & KTHREAD_MPSAFE)
 		l->l_pflag |= LP_MPSAFE;
+	if (flags & KTHREAD_INTR)
+		l->l_pflag |= LP_INTR;
 	rv = rumpuser_thread_create(threadbouncer, k, thrname);
 	if (rv)
 		return rv;

Reply via email to