Properly initialize thread-local RNG state.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user