Module Name:    src
Committed By:   rmind
Date:           Sat Jan 28 12:23:56 UTC 2012

Modified Files:
        src/tests/rump/kernspace: tsleep.c

Log Message:
tsleep(9) no more.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/rump/kernspace/tsleep.c

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

Modified files:

Index: src/tests/rump/kernspace/tsleep.c
diff -u src/tests/rump/kernspace/tsleep.c:1.2 src/tests/rump/kernspace/tsleep.c:1.3
--- src/tests/rump/kernspace/tsleep.c:1.2	Sun Aug  7 14:03:16 2011
+++ src/tests/rump/kernspace/tsleep.c	Sat Jan 28 12:23:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: tsleep.c,v 1.2 2011/08/07 14:03:16 rmind Exp $	*/
+/*	$NetBSD: tsleep.c,v 1.3 2012/01/28 12:23:56 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: tsleep.c,v 1.2 2011/08/07 14:03:16 rmind Exp $");
+__RCSID("$NetBSD: tsleep.c,v 1.3 2012/01/28 12:23:56 rmind Exp $");
 #endif /* !lint */
 
 #include <sys/param.h>
@@ -43,35 +43,6 @@ __RCSID("$NetBSD: tsleep.c,v 1.2 2011/08
 #define NTHREADS 10
 
 /*
- * kernel lock is interlock
- */
-static void
-bigthread(void *arg)
-{
-	static int wakeups;
-	struct simplelock slock;
-	int i;
-
-	simple_lock_init(&slock);
-	for (i = 0; i < 1000; i++) {
-		wakeup(bigthread);
-		if (wakeups >= NTHREADS-1)
-			break;
-		if (arg) {
-			simple_lock(&slock);
-			ltsleep(bigthread, PNORELOCK, "hii", 0, &slock);
-		} else {
-			tsleep(bigthread, 0, "hii", 0);
-		}
-	}
-
-	wakeup(bigthread);
-	wakeups++;
-
-	kthread_exit(0);
-}
-
-/*
  * mpsafe thread.  need dedicated interlock
  */
 static kmutex_t mymtx;
@@ -112,17 +83,9 @@ tinythread(void *arg)
 void
 rumptest_tsleep()
 {
-	struct lwp *bigl[NTHREADS];
 	struct lwp *notbigl[NTHREADS];
 	int rv, i;
 
-	for (i = 0; i < NTHREADS; i++) {
-		rv = kthread_create(PRI_NONE, KTHREAD_MUSTJOIN,
-		    NULL, bigthread, (void *)(uintptr_t)i, &bigl[i], "b");
-		if (rv)
-			panic("thread create failed: %d", rv);
-	}
-
 	mutex_init(&mymtx, MUTEX_DEFAULT, IPL_NONE);
 
 	for (i = 0; i < NTHREADS; i++) {
@@ -133,10 +96,6 @@ rumptest_tsleep()
 	}
 
 	for (i = 0; i < NTHREADS; i++) {
-		kthread_join(bigl[i]);
-	}
-
-	for (i = 0; i < NTHREADS; i++) {
 		kthread_join(notbigl[i]);
 	}
 }

Reply via email to