From 34eb53d425fa0b8f2c2d9f8e7b46425708648367 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 29 Jan 2017 20:15:20 +0300 Subject: [PATCH] Initialize PRNG for background threads. --- src/sysbench.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sysbench.c b/src/sysbench.c index 426bc9d..e111d7e 100644 --- a/src/sysbench.c +++ b/src/sysbench.c @@ -870,6 +870,9 @@ static void *eventgen_thread_proc(void *arg) (void)arg; /* unused */ + /* Initialize thread-local RNG state */ + sb_rand_thread_init(); + SB_LIST_INIT(&event_queue); i = 0; @@ -943,6 +946,9 @@ static void *report_thread_proc(void *arg) (void)arg; /* unused */ + /* Initialize thread-local RNG state */ + sb_rand_thread_init(); + log_text(LOG_DEBUG, "Reporting thread started"); /* Wait for other threads to initialize */ @@ -982,6 +988,9 @@ static void *checkpoints_thread_proc(void *arg) (void)arg; /* unused */ + /* Initialize thread-local RNG state */ + sb_rand_thread_init(); + log_text(LOG_DEBUG, "Checkpoints report thread started"); /* Wait for other threads to initialize */