Whoops, that should've been dispatch_async and not dispatch_queue_async. Silly typing code in an email window...
Dave
On Apr 29, 2010, at 10:26 AM, Dave DeLong wrote:
> #import <dispatch/dispatch.h>
>
> //somewhere reasonably accessible to your producer:
> dispatch_queue_t mySerialQueue =
> dispatch_queue_create("franz.p.paul.myserialqueue", NULL);
>
> //in your producer:
> id newResource = ....; // the thing you want to notifyAll() about
> dispatch_queue_async(mySerialQueue, ^{
> /**
> do something with newResource here.
> this could mean putting your consumer code in here, or passing the
> resource off to another object, etc
> **/
> });
>
> //when you're done producing:
> dispatch_release(mySerialQueue);
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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]
