sys/kern/kern_nrandom.c
static
void
rand_thread_loop(void *dummy)
{
	int count;

	for (;;) {
		NANOUP_EVENT ();
		spin_lock(&rand_spin);
		count = (int)(L15_Byte() * hz / (256 * 10) + hz / 10 + 1);
		spin_unlock(&rand_spin);
		tsleep(rand_td, 0, "rwait", count);
		crit_enter();
		lwkt_deschedule_self(rand_td);
		cpu_sfence();
		rand_thread_signal = 0;
		crit_exit();
		lwkt_switch();
	}
}
/*
 * Random number generator helper thread.  This limits code overhead from
 * high frequency events by delaying the clearing of rand_thread_signal.
 *
 * MPSAFE thread
 */
Random number generator helper thread.  This limits code overhead from
high frequency events by delaying the clearing of rand_thread_signal.

MPSAFE thread
Random number generator helper thread . This limits code overhead from high frequency events by delaying the clearing of rand_thread_signal . MPSAFE thread
static
void
rand_thread_loop(void *dummy)
{
	int count;
	for (;;) {
		NANOUP_EVENT ();
		spin_lock(&rand_spin);
		count = (int)(L15_Byte() * hz / (256 * 10) + hz / 10 + 1);
		spin_unlock(&rand_spin);
		tsleep(rand_td, 0, "rwait", count);
		crit_enter();
		lwkt_deschedule_self(rand_td);
		cpu_sfence();
		rand_thread_signal = 0;
		crit_exit();
		lwkt_switch();
	}
}
static void rand_thread_loop ( void * dummy ) { int count ; for ( ; ; ) { NANOUP_EVENT ( ) ; spin_lock ( & rand_spin ) ; count = ( int ) ( L15_Byte ( ) * hz / ( 256 * 10 ) + hz / 10 + 1 ) ; spin_unlock ( & rand_spin ) ; tsleep ( rand_td , 0 , " " , count ) ; crit_enter ( ) ; lwkt_deschedule_self ( rand_td ) ; cpu_sfence ( ) ; rand_thread_signal = 0 ; crit_exit ( ) ; lwkt_switch ( ) ; } }
Random number generator helper thread.
Random number generator helper thread .