From 3d95aad202e5696f3592c0f0e219cb160b4fcb79 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Wed, 9 Oct 2013 11:50:27 -0400 Subject: [PATCH] no effective changes --- kthread.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kthread.c b/kthread.c index 52288d9..7df20e2 100644 --- a/kthread.c +++ b/kthread.c @@ -136,11 +136,8 @@ void kt_for(int n_threads, int (*func)(void*,void*), void *shared, int n_items, f->func = func; f->w = (ktf_worker_t*)calloc(f->n, sizeof(ktf_worker_t)); - for (i = 0; i < f->n; ++i) { - ktf_worker_t *wi = &f->w[i]; - wi->f = f, wi->i = i; - wi->q = dq_init(dq_bits); - } + for (i = 0; i < f->n; ++i) + f->w[i].f = f, f->w[i].i = i, f->w[i].q = dq_init(dq_bits); tid = (pthread_t*)calloc(f->n, sizeof(pthread_t)); for (i = 0; i < f->n; ++i) pthread_create(&tid[i], 0, ktf_worker, &f->w[i]); -- 2.47.3