diff options
Diffstat (limited to 'include/threads.h')
-rw-r--r-- | include/threads.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/threads.h b/include/threads.h index 0d380322169..80b05546684 100644 --- a/include/threads.h +++ b/include/threads.h @@ -23,6 +23,8 @@ #include "common.h" #if defined(_WINDOWS) + /* the ZBXEndThread function is implemented in service.c file */ + void CALLBACK ZBXEndThread(ULONG_PTR dwParam); #define ZBX_THREAD_ERROR 0 @@ -39,9 +41,9 @@ _endthreadex((unsigned int)(status)); \ return ((unsigned)(status)) - #define zbx_sleep(sec) Sleep(((DWORD)(sec)) * ((DWORD)1000)) + #define zbx_sleep(sec) SleepEx(((DWORD)(sec)) * ((DWORD)1000), TRUE) - #define zbx_thread_kill(h) TerminateThread(h, SUCCEED); + #define zbx_thread_kill(h) QueueUserAPC(ZBXEndThread, h, 0); #else /* not _WINDOWS */ |