>> There is a chance that my calls to performSelectorOnMainThread can have >> waitUntilDone:NO >> >> I use [myNSData writeToFile:path atomically:YES] >> >> NSFileHandle and NSFileManager are shown as not thread safe, but NSData >> is... Perhaps it is ok, but I would think NSData uses one or both of the >> above. >> >> One of the calls to performSelectorOnMainThread may need to wait on a file >> download, but I think that could be a different lock. > > I think you're missing the point: once the thread has detected that it > should quit, it calls as its last statement performSelectorOnMainThread for > whatever needs to be done on the main thread, and then just falls off the > end. When the the selector is called in the main thread, you know at that > point that the thread is done--there's no need to wait for the thread to > terminate. > > What do you need done that is not done by the sample code that I posted?
In the middle of the thread processing, I need to do some processing on a downloaded file. The file may be in the middle of being downloaded, so I need to possibly block until it is ready, then have the main thread do some work, and return to the thread. T. _______________________________________________ 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 [EMAIL PROTECTED]