Thanks all. Those suggestions help. BTW, I inherited the code that does the offending "while" loop. It came from someone's previous attempt to solve exactly one problem: that the secondary thread might finish before the main thread's modal window was even up. I hope I have solved this by starting the thread in the window delegate method windowDidBecomeKey.
Otherwise I have written it so there is no interaction between the threads except for (1) cancellation, (2) the final data that is passed back to the main thread. On cancellation I do use [NSApp abortModal] from the secondary thread, but that is specifically suggested by the Apple documentation. I am now guardedly confident that I have no lurking race conditions etc. Had I not been compelled to support OS X 10.4 I would have re-written the whole thing to use something better than threads - GCD or NSOperationQueue capabilities are said to be safer, although I have not yet learned them. I think this one is resolved for me. Thanks again. Best, - Phil -_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com