- 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.
This commit is contained in:
parent
bd6b65a757
commit
0ccc0648b7
@ -43,6 +43,7 @@
|
|||||||
#include <sys/random.h>
|
#include <sys/random.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/unistd.h>
|
||||||
#include <machine/mutex.h>
|
#include <machine/mutex.h>
|
||||||
#include <crypto/blowfish/blowfish.h>
|
#include <crypto/blowfish/blowfish.h>
|
||||||
|
|
||||||
@ -130,7 +131,7 @@ random_kthread(void *status)
|
|||||||
#ifdef DEBUG1
|
#ifdef DEBUG1
|
||||||
queuecount = 0;
|
queuecount = 0;
|
||||||
#endif
|
#endif
|
||||||
TAILQ_FOREACH(event, &harvestqueue, harvest) {
|
while (!TAILQ_EMPTY(&harvestqueue)) {
|
||||||
#ifdef DEBUG1
|
#ifdef DEBUG1
|
||||||
queuecount++;
|
queuecount++;
|
||||||
#endif
|
#endif
|
||||||
@ -227,7 +228,7 @@ random_init(void)
|
|||||||
|
|
||||||
/* Start the hash/reseed thread */
|
/* Start the hash/reseed thread */
|
||||||
error = kthread_create(random_kthread, &random_kthread_status,
|
error = kthread_create(random_kthread, &random_kthread_status,
|
||||||
&random_kthread_proc, 0, "random");
|
&random_kthread_proc, RFHIGHPID, "random");
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include <sys/random.h>
|
#include <sys/random.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/unistd.h>
|
||||||
#include <machine/mutex.h>
|
#include <machine/mutex.h>
|
||||||
#include <crypto/blowfish/blowfish.h>
|
#include <crypto/blowfish/blowfish.h>
|
||||||
|
|
||||||
@ -130,7 +131,7 @@ random_kthread(void *status)
|
|||||||
#ifdef DEBUG1
|
#ifdef DEBUG1
|
||||||
queuecount = 0;
|
queuecount = 0;
|
||||||
#endif
|
#endif
|
||||||
TAILQ_FOREACH(event, &harvestqueue, harvest) {
|
while (!TAILQ_EMPTY(&harvestqueue)) {
|
||||||
#ifdef DEBUG1
|
#ifdef DEBUG1
|
||||||
queuecount++;
|
queuecount++;
|
||||||
#endif
|
#endif
|
||||||
@ -227,7 +228,7 @@ random_init(void)
|
|||||||
|
|
||||||
/* Start the hash/reseed thread */
|
/* Start the hash/reseed thread */
|
||||||
error = kthread_create(random_kthread, &random_kthread_status,
|
error = kthread_create(random_kthread, &random_kthread_status,
|
||||||
&random_kthread_proc, 0, "random");
|
&random_kthread_proc, RFHIGHPID, "random");
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user