From cb9a2cdc293b1d60d551b4d3de00c69586a98544 Mon Sep 17 00:00:00 2001 From: VadimTk Date: Fri, 8 Apr 2016 17:34:50 +0000 Subject: [PATCH] Revert "Fix the issue when threads running < num_threads" This reverts commit 06aa4d2d6b16a5c6fac5884681bd32d12f47ef34. --- sysbench/sysbench.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sysbench/sysbench.c b/sysbench/sysbench.c index 5a2fdae..c008037 100644 --- a/sysbench/sysbench.c +++ b/sysbench/sysbench.c @@ -474,7 +474,6 @@ static void *runner_thread(void *arg) thread_id = ctxt->id; log_text(LOG_DEBUG, "Runner thread started (%d)!", thread_id); - pthread_mutex_lock(&thread_start_mutex); if (test->ops.thread_init != NULL && test->ops.thread_init(thread_id) != 0) { sb_globals.error = 1; @@ -485,11 +484,9 @@ static void *runner_thread(void *arg) We do this to make sure all threads get to this barrier about the same time */ + pthread_mutex_lock(&thread_start_mutex); sb_globals.num_running++; pthread_mutex_unlock(&thread_start_mutex); - while(sb_globals.num_running < sb_globals.num_threads) { - sleep(1); - } do {