Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump/rumpkern set LP_INTR for KTHREAD_INTR



details:   https://anonhg.NetBSD.org/src/rev/a5af7cc3a172
branches:  trunk
changeset: 748908:a5af7cc3a172
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Nov 09 19:00:52 2009 +0000

description:
set LP_INTR for KTHREAD_INTR

diffstat:

 sys/rump/librump/rumpkern/threads.c |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (55 lines):

diff -r 94d46573239d -r a5af7cc3a172 sys/rump/librump/rumpkern/threads.c
--- a/sys/rump/librump/rumpkern/threads.c       Mon Nov 09 18:00:26 2009 +0000
+++ b/sys/rump/librump/rumpkern/threads.c       Mon Nov 09 19:00:52 2009 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index