2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

switch to _beginthreadex; close thread handle after join

This commit is contained in:
Bob Halley 1998-10-23 18:24:18 +00:00
parent ce1e4ac907
commit 1eda5e1a7c

View File

@ -5,16 +5,16 @@ isc_result_t
isc_thread_create(isc_threadfunc_t start, isc_threadarg_t arg, isc_thread_create(isc_threadfunc_t start, isc_threadarg_t arg,
isc_thread_t *threadp) isc_thread_t *threadp)
{ {
HANDLE h; isc_thread_t thread;
DWORD id; unsigned int id;
h = CreateThread(NULL, 0, start, arg, 0, &id); thread = (isc_thread_t)_beginthreadex(NULL, 0, start, arg, 0, &id);
if (h == NULL) { if (thread == NULL) {
/* XXX */ /* XXX */
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
*threadp = h; *threadp = thread;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
@ -32,6 +32,7 @@ isc_thread_join(isc_thread_t thread, isc_threadresult_t *rp) {
/* XXX */ /* XXX */
return (ISC_R_UNEXPECTED); return (ISC_R_UNEXPECTED);
} }
(void)CloseHandle(thread);
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }