discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Waiting for threads


From: Raffael Herzog
Subject: Waiting for threads
Date: Tue, 22 Jul 2003 16:39:13 +0200

Hi,

Situation:

- An object (a) starts a new thread when initialized
- This object a is also a factory for other objects (b), each of which starts its own thread, too - When object a receives a dealloc message, it sets its status accordingly causing all those threads to exit ASAP

The problem is this "ASAP". I don't know exactly *when* a thread actually exited, but I need to make sure that all dependent threads have exited before the object that started them gets deallocated. What I'm looking for is something like Thread#join() in Java:

Thread myThread = new Thread(myRunnable);
myThread.start();
// do something...
myThread.requestStop(); // ask the detached thread to exit
myThread.join(); // wait until the thread actually exited

How can this be achieved with GNUstep?


TIA,
  Raffi

--
 The difference between theory and practice is that in theory, there is
                no difference, but in practice, there is.

Raffael Herzog - herzog@raffael.ch - http://www.raffael.ch - ICQ #67961355





reply via email to

[Prev in Thread] Current Thread [Next in Thread]