Commit c2509944 authored by Andres Freund's avatar Andres Freund

Fix bug slowing down pgbench when -P is used.

A removed check in ba3deeef made all threads but the main one busy-loop
when -P was used. All threads computed the time to the next time the
progress report should be printed, but only the main thread did so and
re-scheduled it only for the future.

Reported-By: Jesper Pedersen
Discussion: 55C4E190.3050104@redhat.com
parent 89db8392
...@@ -3646,7 +3646,7 @@ threadRun(void *arg) ...@@ -3646,7 +3646,7 @@ threadRun(void *arg)
} }
/* also wake up to print the next progress report on time */ /* also wake up to print the next progress report on time */
if (progress && min_usec > 0) if (progress && min_usec > 0 && thread->tid == 0)
{ {
/* get current time if needed */ /* get current time if needed */
if (now_usec == 0) if (now_usec == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment