I just noticed in the documentation the following description:

  Note, unlike in Cocoa (and perhaps OpenStep), the thread will not
  exit when the method finishes execution. 

  You must call [Thread +exit] yourself (from the thread) to terminate
  it.

Is there a good reason for deviating from Cocoa?  
To me the Cocoa behaviour looks more natural.  The GNUstep
behaviour forces you to know if a method is started with 
[NSThread detachNewThread...].

So in a multi threaded program you should write a method 
as follows:

- doSomethingInteresting
{
        arp = [NSAutoreleasePool new];

        // Do interesting stuff

        DESTROY (arp)
        
        if we are stared from a different thread
           {
           [NSThread exit];
           }
}


The last part worries me, it seems you need to have knowledge
on how you are called.

I am probably missing something very obvious.


Wim Oudshoorn


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to