On Jul 1, 2011, at 2:54 AM, Oleg Krupnov wrote: > But this seems a bit clunky (compared to the elegance of GCD code), > and also I'm not sure if it will be thread-safe to set m_isCancelled > from the main thread, while the async block may be racing to query it > (though it should be fine, setting a boolean variable should be > atomic). > > Is there a better solution?
You can declare the boolean as an atomic property and synthesize it. Then, it will be sure to be atomic, no matter what. Charles_______________________________________________ Cocoa-dev mailing list ([email protected]) 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]
