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 Reset l_mutex when waking up a thr...



details:   https://anonhg.NetBSD.org/src/rev/6363c562a33f
branches:  trunk
changeset: 756551:6363c562a33f
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Jul 22 21:00:07 2010 +0000

description:
Reset l_mutex when waking up a thread.  select uses it to determine
if a thread is still selecting, and would get a KASSERT panic if
the thread had been woken up but not run yet when selnotify() was
called.

diffstat:

 sys/rump/librump/rumpkern/sleepq.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 30648a830799 -r 6363c562a33f sys/rump/librump/rumpkern/sleepq.c
--- a/sys/rump/librump/rumpkern/sleepq.c        Thu Jul 22 19:28:25 2010 +0000
+++ b/sys/rump/librump/rumpkern/sleepq.c        Thu Jul 22 21:00:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sleepq.c,v 1.6 2009/11/17 15:23:42 pooka Exp $ */
+/*     $NetBSD: sleepq.c,v 1.7 2010/07/22 21:00:07 pooka Exp $ */
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sleepq.c,v 1.6 2009/11/17 15:23:42 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sleepq.c,v 1.7 2010/07/22 21:00:07 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -112,6 +112,7 @@
                if (l->l_wchan == wchan) {
                        found = true;
                        l->l_wchan = NULL;
+                       l->l_mutex = NULL;
                        TAILQ_REMOVE(sq, l, l_sleepchain);
                }
        }
@@ -127,6 +128,7 @@
 {
 
        l->l_wchan = NULL;
+       l->l_mutex = NULL;
        TAILQ_REMOVE(l->l_sleepq, l, l_sleepchain);
        cv_broadcast(&sq_cv);
 



Home | Main Index | Thread Index | Old Index