From 1eda5e1a7ce97ea997f2cfbaaf6bee1da5ea0e7e Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Fri, 23 Oct 1998 18:24:18 +0000 Subject: [PATCH] switch to _beginthreadex; close thread handle after join --- lib/isc/win32/thread.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/isc/win32/thread.c b/lib/isc/win32/thread.c index 5c80ff9e5f..be0515ebf6 100644 --- a/lib/isc/win32/thread.c +++ b/lib/isc/win32/thread.c @@ -5,16 +5,16 @@ isc_result_t isc_thread_create(isc_threadfunc_t start, isc_threadarg_t arg, isc_thread_t *threadp) { - HANDLE h; - DWORD id; + isc_thread_t thread; + unsigned int id; - h = CreateThread(NULL, 0, start, arg, 0, &id); - if (h == NULL) { + thread = (isc_thread_t)_beginthreadex(NULL, 0, start, arg, 0, &id); + if (thread == NULL) { /* XXX */ return (ISC_R_UNEXPECTED); } - *threadp = h; + *threadp = thread; return (ISC_R_SUCCESS); } @@ -32,6 +32,7 @@ isc_thread_join(isc_thread_t thread, isc_threadresult_t *rp) { /* XXX */ return (ISC_R_UNEXPECTED); } + (void)CloseHandle(thread); return (ISC_R_SUCCESS); }