Hi,

I'm running into some trouble with NSOperation / NSOperationQueue.

In order to tear down everything gracefully, I use something like

        [queue cancelAllOperations];
        [queue waitUntilAllOperationsAreFinished];

My NSOperation subclasses just have a straightforward -(void) main method.

It works as advertised for me unless I'm trying to cancel the operations.

Regular run:
 (MyOperation) change of isExecuting to 1
 (MyOperation) change of isExecuting to 0
 (MyOperation) change of isFinished to 1

Cancel run:
 (MyOperation) change of isExecuting to 1
** Cancel...
(MyOperation) change of isCancelled to 1

My op polls isCancelled, returns from main and nothing more happens. op.isFinished and op.isExecuting is not updated, bringing waitUntilAllOperationsAreFinished and other KVC observers to an halt. Do I really need to reimplement the whole state (isFinished, isExecuting) logic just in order to support cancellation?

TIA,
        Tom_E


_______________________________________________

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]

Reply via email to