Module Name:    src
Committed By:   pooka
Date:           Fri Oct 16 02:13:54 UTC 2009

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

Log Message:
In case of timeout, remember to remove ourselves from the sleep staleq.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/librump/rumpkern/sleepq.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/sleepq.c
diff -u src/sys/rump/librump/rumpkern/sleepq.c:1.3 src/sys/rump/librump/rumpkern/sleepq.c:1.4
--- src/sys/rump/librump/rumpkern/sleepq.c:1.3	Fri Oct 16 00:14:53 2009
+++ src/sys/rump/librump/rumpkern/sleepq.c	Fri Oct 16 02:13:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sleepq.c,v 1.3 2009/10/16 00:14:53 pooka Exp $	*/
+/*	$NetBSD: sleepq.c,v 1.4 2009/10/16 02:13:54 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.3 2009/10/16 00:14:53 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sleepq.c,v 1.4 2009/10/16 02:13:54 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -74,8 +74,10 @@
 	int biglocks = l->l_biglocks;
 
 	while (l->l_wchan) {
-		if ((error=cv_timedwait(&sq_cv, mp, timo)) == EWOULDBLOCK)
+		if ((error=cv_timedwait(&sq_cv, mp, timo)) == EWOULDBLOCK) {
+			TAILQ_REMOVE(l->l_sleepq, l, l_sleepchain);
 			l->l_wchan = NULL;
+		}
 	}
 	mutex_spin_exit(mp);
 

Reply via email to