|
From: Robert C. <rob...@it...> - 2001-09-26 00:28:16
|
On Wed, 2001-09-26 at 10:09, Mark Weaver wrote:
> >From reading the ReactOS code for ExitThread (lib\kernel32\thread\thread.c),
> ExitThread will terminate the process if the thread to exit is the last
> thread in the process. AFAIK NT will terminate the process if the first
> thread created exits, i.e.
My understanding is that all threads have to exit, or ExitProcess() has
to be called. (this is based on cygwin, where we have to emulate
pthreads behaviour - and it works fine).
Possibly your linker is called ExitProcess not ExitThread when you
return(). Try this:
DWORD CALLBACK ThreadProc(LPVOID)
{
while (1) {
Sleep(1000);
}
return 0;
}
int main()
{
DWORD dwThread;
if (!CreateThread(NULL,0,ThreadProc,NULL,0,&dwThread))
printf("No thread: %d\n",GetLastError());
sleep(1);
ExitThread(NULL);
}
Rob
====================================================
= To remove yourself from this mailing list, go to =
= http://www.reactos.com/home/mailing.html =
====================================================
|