Module Name:    src
Committed By:   pooka
Date:           Fri Sep  4 13:58:57 UTC 2009

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

Log Message:
* wrap tsleep functions to drop die grosslock since we're going to
  sleep anyway in a few flicks from the clock
* broadcast instead of signal in wakeup()


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/librump/rumpkern/ltsleep.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/ltsleep.c
diff -u src/sys/rump/librump/rumpkern/ltsleep.c:1.14 src/sys/rump/librump/rumpkern/ltsleep.c:1.15
--- src/sys/rump/librump/rumpkern/ltsleep.c:1.14	Tue Jun  9 23:26:19 2009
+++ src/sys/rump/librump/rumpkern/ltsleep.c	Fri Sep  4 13:58:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ltsleep.c,v 1.14 2009/06/09 23:26:19 pooka Exp $	*/
+/*	$NetBSD: ltsleep.c,v 1.15 2009/09/04 13:58:57 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.14 2009/06/09 23:26:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.15 2009/09/04 13:58:57 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -56,6 +56,9 @@
 	volatile struct simplelock *slock)
 {
 	struct ltsleeper lts;
+	int nlocks;
+
+	KERNEL_UNLOCK_ALL(curlwp, &nlocks);
 
 	lts.id = ident;
 	cv_init(&lts.cv, NULL);
@@ -76,6 +79,7 @@
 	if (slock && (prio & PNORELOCK) == 0)
 		simple_lock(slock);
 
+	KERNEL_LOCK(nlocks, curlwp);
 	return 0;
 }
 
@@ -84,6 +88,9 @@
 	kmutex_t *lock)
 {
 	struct ltsleeper lts;
+	int nlocks;
+
+	KERNEL_UNLOCK_ALL(curlwp, &nlocks);
 
 	lts.id = ident;
 	cv_init(&lts.cv, NULL);
@@ -103,6 +110,7 @@
 	if ((prio & PNORELOCK) == 0)
 		mutex_enter(lock);
 
+	KERNEL_LOCK(nlocks, curlwp);
 	return 0;
 }
 
@@ -114,7 +122,7 @@
 	mutex_enter(&sleepermtx);
 	LIST_FOREACH(ltsp, &sleepers, entries)
 		if (ltsp->id == ident)
-			cv_signal(&ltsp->cv);
+			cv_broadcast(&ltsp->cv);
 	mutex_exit(&sleepermtx);
 }
 

Reply via email to