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?