diff options
Diffstat (limited to 'storage/innobase/page/page0cur.cc')
-rw-r--r-- | storage/innobase/page/page0cur.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 257b7a21050..4fdfafa5d0a 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -41,7 +41,7 @@ number between 0 and 2^64-1 inclusive. The formula and the constants being used are: X[n+1] = (a * X[n] + c) mod m where: -X[0] = ut_time_us(NULL) +X[0] = my_interval_timer() a = 1103515245 (3^5 * 5 * 7 * 129749) c = 12345 (3 * 5 * 823) m = 18446744073709551616 (2^64) @@ -54,12 +54,10 @@ page_cur_lcg_prng(void) { #define LCG_a 1103515245 #define LCG_c 12345 - static ib_uint64_t lcg_current = 0; - static ibool initialized = FALSE; + static uint64_t lcg_current; - if (!initialized) { - lcg_current = (ib_uint64_t) ut_time_us(NULL); - initialized = TRUE; + if (!lcg_current) { + lcg_current = my_interval_timer(); } /* no need to "% 2^64" explicitly because lcg_current is |