Additional spinlock in random_jkiss. Initial attempt at implementing dummy sessions to provide total consistency - used in mysql_client in relation to authentication - a single static dummy session is used and linked from the client dcb when authentication is not yet complete.
This commit is contained in:
@ -117,11 +117,13 @@ static void
|
||||
random_init_jkiss(void)
|
||||
{
|
||||
int newrand, i;
|
||||
spinlock_acquire(&random_jkiss_spinlock);
|
||||
if ((newrand = random_jkiss_devrand()) != 0) x = newrand;
|
||||
if ((newrand = random_jkiss_devrand()) != 0) y = newrand;
|
||||
if ((newrand = random_jkiss_devrand()) != 0) z = newrand;
|
||||
if ((newrand = random_jkiss_devrand()) != 0)
|
||||
c = newrand % 698769068 + 1; /* Should be less than 698769069 */
|
||||
spinlock_release(&random_jkiss_spinlock);
|
||||
|
||||
/* "Warm up" our random number generator */
|
||||
for (i = 0; i < 100; i++) random_jkiss();
|
||||
|
Reference in New Issue
Block a user