Properly initialize thread-local RNG state.

This commit is contained in:
Alexey Kopytov
2016-02-24 21:34:19 +08:00
parent a7d9d4409b
commit 1c9ddea0e2
2 changed files with 3 additions and 3 deletions

View File

@ -39,9 +39,6 @@
int sb_thread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg)
{
/* Initialize thread-local RNG state */
sb_srnd(sb_rnd());
return pthread_create(thread, attr, start_routine, arg);
}

View File

@ -468,6 +468,9 @@ static void *runner_thread(void *arg)
test = ctxt->test;
thread_id = ctxt->id;
/* Initialize thread-local RNG state */
sb_srnd(thread_id);
log_text(LOG_DEBUG, "Runner thread started (%d)!", thread_id);
if (test->ops.thread_init != NULL && test->ops.thread_init(thread_id) != 0)
{