On 11.01.2013, at 20:45, Jens Alfke <j...@mooseyard.com> wrote:
> Then you’ll need to block the main thread until the background thread 
> finishes its work. You could use an NSConditionLock to do that — main thread 
> creates the lock and locks it, passes the lock to the background thread, then 
> blocks waiting for the condition to change. The background thread sets the 
> condition when it finishes its work.

 If for some reason this doesn't work, you could also try running an NSRunLoop 
in the main thread that checks for your second thread being finished. Haven't 
tried that, but it would keep the main thread from returning until you actually 
have data.

 Of course, in any way, both approaches would probably cause the app from which 
your service was invoked to beachball until you return.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://groups.yahoo.com/group/mac-gui-dev/




_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to