diff options
-rw-r--r-- | include/threads.h | 14 | ||||
-rw-r--r-- | src/libs/zbxsys/threads.c | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/include/threads.h b/include/threads.h index a926cd8c9d3..57c5c7890dc 100644 --- a/include/threads.h +++ b/include/threads.h @@ -26,10 +26,12 @@ /* the ZBXEndThread function is implemented in service.c file */ void CALLBACK ZBXEndThread(ULONG_PTR dwParam); - #define ZBX_THREAD_ERROR 0 + #define ZBX_THREAD_ERROR 0 - #define ZBX_THREAD_HANDLE HANDLE - #define ZBX_THREAD_HANDLE_NULL NULL + #define ZBX_THREAD_HANDLE HANDLE + #define ZBX_THREAD_HANDLE_NULL NULL + + #define ZBX_THREAD_PRIORITY_NONE 0 #define ZBX_THREAD_ENTRY_POINTER(pointer_name) \ unsigned (__stdcall *pointer_name)(void *) @@ -50,10 +52,10 @@ int zbx_fork(void); void zbx_child_fork(pid_t *pid); - #define ZBX_THREAD_ERROR -1 + #define ZBX_THREAD_ERROR -1 - #define ZBX_THREAD_HANDLE pid_t - #define ZBX_THREAD_HANDLE_NULL 0 + #define ZBX_THREAD_HANDLE pid_t + #define ZBX_THREAD_HANDLE_NULL 0 #define ZBX_THREAD_PRIORITY_NONE 0 #define ZBX_THREAD_PRIORITY_FIRST 1 diff --git a/src/libs/zbxsys/threads.c b/src/libs/zbxsys/threads.c index ace1fe4dcd4..d13ac89ce3c 100644 --- a/src/libs/zbxsys/threads.c +++ b/src/libs/zbxsys/threads.c @@ -292,7 +292,7 @@ void zbx_threads_wait(ZBX_THREAD_HANDLE *threads, const int *threads_flags, int #else /* wait for threads to finish first. although listener threads will never end */ WaitForMultipleObjectsEx(threads_num, threads, TRUE, 1000, FALSE); - threads_kill(threads, threads_num, ret); + threads_kill(threads, threads_num, threads_flags, ZBX_THREAD_PRIORITY_NONE, ret); #endif for (i = 0; i < threads_num; i++) |