From 12d8660f72670f76b4a208dbe340a3b3c73afb1f Mon Sep 17 00:00:00 2001 From: "Troy D. Hanson" Date: Thu, 31 Mar 2016 23:57:16 -0400 Subject: [PATCH] fix --- utils/kvsp-kkpub.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/utils/kvsp-kkpub.c b/utils/kvsp-kkpub.c index 5cc2a74..5bdccf3 100644 --- a/utils/kvsp-kkpub.c +++ b/utils/kvsp-kkpub.c @@ -506,16 +506,18 @@ int main(int argc, char *argv[]) { rc = pthread_create(&CF.spr_thread, NULL, spr_worker, NULL); if (rc) goto done; CF.enc_thread = malloc(sizeof(pthread_t)*CF.nthread); if (CF.enc_thread == NULL) goto done; - void *id; - for(i=0, id=NULL; i < CF.nthread; i++, id++) { - rc = pthread_create(&CF.enc_thread[i],NULL,enc_worker,id); + long id; + for(i=0; i < CF.nthread; i++) { + id = i; + rc = pthread_create(&CF.enc_thread[i],NULL,enc_worker,(void*)id); if (rc) goto done; } CF.kaf_thread = malloc(sizeof(pthread_t)*CF.nthread); if (CF.kaf_thread == NULL) goto done; - for(i=0, id=NULL; i < CF.nthread; i++, id++) { - rc = pthread_create(&CF.kaf_thread[i],NULL,kaf_worker,id); + for(i=0; i < CF.nthread; i++) { + id = i; + rc = pthread_create(&CF.kaf_thread[i],NULL,kaf_worker,(void*)id); if (rc) goto done; }