[ticket/10100] Update rand_seed_last_update before rand_seed in unique_id().

Update $config['rand_seed_last_update'] before updating $config['rand_seed'] in
unique_id() to mitigate a race condition and unnecessary updates on heavily
busy boards.

PHPBB3-10100
This commit is contained in:
Andreas Fischer 2011-03-17 23:01:07 +01:00
parent 784132d7e8
commit 48ba841be0

View file

@ -240,8 +240,8 @@ function unique_id($extra = 'c')
if ($dss_seeded !== true && ($config['rand_seed_last_update'] < time() - rand(1,10)))
{
set_config('rand_seed', $config['rand_seed'], true);
set_config('rand_seed_last_update', time(), true);
set_config('rand_seed', $config['rand_seed'], true);
$dss_seeded = true;
}