Re: How do I make one thread wait until another thread exits?

2009-02-13 Thread Michael Ash
On Thu, Feb 12, 2009 at 11:08 AM, Oleg Krupnov oleg.krup...@gmail.com wrote: Thanks, Mike. I assume that I need to also use #define OPERATION_NOT_FINISHED 0 and condLock = [[NSConditionLock alloc] initWithCondition: OPERATION_NOT_FINISHED]; Right? Strictly speaking this is

Re: How do I make one thread wait until another thread exits?

2009-02-13 Thread James Bucanek
Oleg Krupnov mailto:oleg.krup...@gmail.com wrote (Thursday, February 12, 2009 9:08 AM +0200): Thanks, Mike. I assume that I need to also use #define OPERATION_NOT_FINISHED 0 and condLock = [[NSConditionLock alloc] initWithCondition: OPERATION_NOT_FINISHED]; Right? I have a doubt here,

How do I make one thread wait until another thread exits?

2009-02-12 Thread Oleg Krupnov
This seems a trivial question for a multi-threading app, but I haven't been successful in implementing this in Cocoa. I've got deadlocks and strange logs for seemingly no reason. Here's my problem: There is the main thread that starts a worker NSOperation to do some job (-[NSOperationQueue

Re: How do I make one thread wait until another thread exits?

2009-02-12 Thread Michael Ash
On Thu, Feb 12, 2009 at 4:25 AM, Oleg Krupnov oleg.krup...@gmail.com wrote: This seems a trivial question for a multi-threading app, but I haven't been successful in implementing this in Cocoa. I've got deadlocks and strange logs for seemingly no reason. Here's my problem: There is the main

Re: How do I make one thread wait until another thread exits?

2009-02-12 Thread Oleg Krupnov
Thanks, Mike. I assume that I need to also use #define OPERATION_NOT_FINISHED 0 and condLock = [[NSConditionLock alloc] initWithCondition: OPERATION_NOT_FINISHED]; Right? I have a doubt here, however. What if the cancel message is sent even before the worker thread had the possibility to