Commit 1eda5e1a authored by Bob Halley's avatar Bob Halley

switch to _beginthreadex; close thread handle after join

parent ce1e4ac9
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment