|
From: Mark W. <ma...@np...> - 2001-09-26 00:34:29
|
you are right, please ignore my ramblings!
> -----Original Message-----
> From: Robert Collins [mailto:rob...@it...]
> Sent: 26 September 2001 01:27
> To: ros...@re...
> Subject: [ros-kernel] Re: ROS ExitThread behaviour different from NT
>
>
> 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 =
> ====================================================
>
>
====================================================
= To remove yourself from this mailing list, go to =
= http://www.reactos.com/home/mailing.html =
====================================================
|