Re: Sublclassing NSThread
Re: Sublclassing NSThread
- Subject: Re: Sublclassing NSThread
- From: Frédéric Testuz <email@hidden>
- Date: Wed, 17 Dec 2008 18:29:07 +0100
Le 17 déc. 08 à 17:14, Keith Duncan a écrit :
On 17 Dec 2008, at 15:41, Jean-Daniel Dupas wrote:
because there's absolutely no way to guarantee that only a single
NSOperationQueue
exists in your process
Couldn't you swizzle +[NSOperationQueue alloc] to return a
singleton? Sure it's a hack, but a simple one that can be #ifdefed
out for post Leopard builds. And would fix the problem for now if
you've already architected a project around operation queues.
And -waitUntilAllOperationsAreFinished became useless : one of your
thread create an operation queue and add some operations then wait for
them to finish. But meanwhile another thread, perhaps in a frameeork
you dont control, create also an operation queue and add some
operations. Because of the singleton, your thread can wait a long time
to continue.
Frédéric_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden