Fix an issue where the random number generator's random event injector
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 16 Feb 2008 20:40:47 +0000 (20:40 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 16 Feb 2008 20:40:47 +0000 (20:40 +0000)
commit53d9cb720f1493f4a078de3ded81ce8cfa843104
tree265a50b32fa91d70d88146cf69cc189ae71b365d
parent420eedf5341b421973f79533ce04d1e64aa0397d
Fix an issue where the random number generator's random event injector
can stall.  An interrupt could occur after rand_thread_signal is set to
0 but before the injector thread deschedules itself, resulting in the
interrupt waking up the thread before it has gone to sleep and stalling
it forever.  Also swap around the variable ordering so the SMP race
that occurs is non-harmful.  Continue to allow the race.

Reported-by: Robin Carey <robin_carey5@yahoo.co.uk>
sys/kern/kern_nrandom.c