From b7dde81d1e3216597fb440bc3f857185221e3517 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Tue, 3 Dec 2019 21:20:41 +0800 Subject: [PATCH] function create_work_threads changed --- HISTORY | 3 ++- src/pthread_func.c | 19 ++++++++++--------- src/pthread_func.h | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/HISTORY b/HISTORY index e68c91b..e8bd699 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,7 @@ -Version 1.42 2019-11-30 +Version 1.42 2019-12-03 * add function get_gzip_command_filename + * function create_work_threads changed Version 1.41 2019-09-30 * change CIDR network_bits range from [16, 32) to [10, 32) diff --git a/src/pthread_func.c b/src/pthread_func.c index 9182b93..a66bd10 100644 --- a/src/pthread_func.c +++ b/src/pthread_func.c @@ -136,11 +136,12 @@ int init_pthread_attr(pthread_attr_t *pattr, const int stack_size) return 0; } -int create_work_threads(int *count, void *(*start_func)(void *), \ - void *arg, pthread_t *tids, const int stack_size) +int create_work_threads(int *count, void *(*start_func)(void *), + void **args, pthread_t *tids, const int stack_size) { int result; pthread_attr_t thread_attr; + void **current_arg; pthread_t *ptid; pthread_t *ptid_end; @@ -151,16 +152,16 @@ int create_work_threads(int *count, void *(*start_func)(void *), \ result = 0; ptid_end = tids + (*count); - for (ptid=tids; ptid