Implemented _beginthreadex and _endthreadex

svn path=/trunk/; revision=4558
This commit is contained in:
Gé van Geldorp 2003-04-20 19:42:50 +00:00
parent 628cc3fad9
commit 0f4fba969a

View file

@ -1,4 +1,4 @@
/* $Id: threadx.c,v 1.1 2002/11/29 16:00:21 robd Exp $ /* $Id: threadx.c,v 1.2 2003/04/20 19:42:50 gvg Exp $
* *
*/ */
#include <windows.h> #include <windows.h>
@ -14,13 +14,30 @@ unsigned long _beginthreadex(
unsigned initflag, unsigned initflag,
unsigned* thrdaddr) unsigned* thrdaddr)
{ {
HANDLE NewThread;
/*
* Just call the API function. Any CRT specific processing is done in
* DllMain DLL_THREAD_ATTACH
*/
NewThread = CreateThread(security, stack_size, start_address, arglist, initflag, thrdaddr);
if (NULL == NewThread)
{
/* FIXME map GetLastError() to errno */
errno = ENOSYS; errno = ENOSYS;
return (unsigned long)-1; }
return (unsigned long) NewThread;
} }
void _endthreadex(unsigned retval) void _endthreadex(unsigned retval)
{ {
/*
* Just call the API function. Any CRT specific processing is done in
* DllMain DLL_THREAD_DETACH
*/
ExitThread(retval);
} }
/* EOF */ /* EOF */