From 7bceb564014a97b780f3ecdefec55f88928e67bc Mon Sep 17 00:00:00 2001 From: David Phillips Date: Fri, 6 May 2016 00:23:52 +1200 Subject: Revert "Revert to thread 0 for progress monitoring" It wasn't a bug after all. This reverts commit 7829acdb73ac143cbe550a7ea84beebdd71f0eda. --- fractal-gen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fractal-gen.c b/fractal-gen.c index 5e1e146..612e7ce 100644 --- a/fractal-gen.c +++ b/fractal-gen.c @@ -132,10 +132,11 @@ int main(int argc, char **argv) pthread_create(§ions[i].thread, NULL, generator, &(sections[i])); } - s = &(sections[0]); + s = &(sections[cores-1]); while((x = s->idx) < s->datasize) { - fprintf(stderr, "Thread 0: %.4f%%\r", + fprintf(stderr, "Thread %d: %.4f%%\r", + cores-1, 100.f*(double)x/s->datasize); sleep(1); } -- cgit v1.1