From 2ed0f9191a2ec26a674e997088693e5760d9feb4 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 11 Sep 2000 04:09:08 +0000 Subject: [PATCH] - Use RFHIGHPID when creating the kthread to get a more sensible pid. - Don't fake walking a tailq. Instead, use a while loop that pulls items off the head of the queue while the queue is not empty. --- sys/dev/random/yarrow.c | 5 +++-- sys/dev/randomdev/yarrow.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/random/yarrow.c b/sys/dev/random/yarrow.c index d882480f8a8..46c1a2cff30 100644 --- a/sys/dev/random/yarrow.c +++ b/sys/dev/random/yarrow.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -130,7 +131,7 @@ random_kthread(void *status) #ifdef DEBUG1 queuecount = 0; #endif - TAILQ_FOREACH(event, &harvestqueue, harvest) { + while (!TAILQ_EMPTY(&harvestqueue)) { #ifdef DEBUG1 queuecount++; #endif @@ -227,7 +228,7 @@ random_init(void) /* Start the hash/reseed thread */ error = kthread_create(random_kthread, &random_kthread_status, - &random_kthread_proc, 0, "random"); + &random_kthread_proc, RFHIGHPID, "random"); if (error != 0) return error; diff --git a/sys/dev/randomdev/yarrow.c b/sys/dev/randomdev/yarrow.c index d882480f8a8..46c1a2cff30 100644 --- a/sys/dev/randomdev/yarrow.c +++ b/sys/dev/randomdev/yarrow.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -130,7 +131,7 @@ random_kthread(void *status) #ifdef DEBUG1 queuecount = 0; #endif - TAILQ_FOREACH(event, &harvestqueue, harvest) { + while (!TAILQ_EMPTY(&harvestqueue)) { #ifdef DEBUG1 queuecount++; #endif @@ -227,7 +228,7 @@ random_init(void) /* Start the hash/reseed thread */ error = kthread_create(random_kthread, &random_kthread_status, - &random_kthread_proc, 0, "random"); + &random_kthread_proc, RFHIGHPID, "random"); if (error != 0) return error;