Re: -[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Jerry Krinock
OK, I submitted some Document Feedback on -cancelAllOperations, referring to this thread in the list archives and complaining that the statement "Queued operations are cancelled before they begin executing" seems to be an oversimplification. And I was able to solve my deadlock with -waitUntilAl

Re: -[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Ken Thomases
On Mar 31, 2010, at 5:03 PM, Jerry Krinock wrote: > So Ken I believe you're saying that the "cancelled" operations become ready > to run immediately, which they do (as no-ops), which removes them from the > queue. In *effect* therefore, "are cancelled before they begin executing" > *does indee

Re: -[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Jerry Krinock
On 2010 Mar 31, at 15:03, Jerry Krinock wrote: > So Ken I believe you're saying that the "cancelled" operations become ready > to run immediately, which they do (as no-ops), which removes them from the > queue. In *effect* therefore, "are cancelled before they begin executing" > *does indeed*

Re: -[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Jerry Krinock
On 2010 Mar 31, at 14:39, Mike Abdullah wrote: > [self cancelAllOperations]; > [self waitUntilAllOperationsAreFinished]; > > Cancelling the operations is asynchronous since an in-progress op may take a > little while to finish up. OK, but does -cancelAllOperations ultimately remove all operati

Re: -[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Ken Thomases
On Mar 31, 2010, at 4:32 PM, Jerry Krinock wrote: >[self cancelAllOperations] ; > So you see in NSLog #1 there are 5 operations in the queue. This is > expected, because although the documentation for -cancelAllOperations is a > little vague, it does not say that it *removes* any operation

Re: -[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Mike Abdullah
[self cancelAllOperations]; [self waitUntilAllOperationsAreFinished]; Cancelling the operations is asynchronous since an in-progress op may take a little while to finish up. Mike. On 31 Mar 2010, at 22:32, Jerry Krinock wrote: > I execute the following code in a subclass of NSOperationQueue: >

-[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Jerry Krinock
I execute the following code in a subclass of NSOperationQueue: if (error) { NSLog(@"Cancelling all operations due to error") ; [self cancelAllOperations] ; } NSLog(@"#1 Remaining operations in %p:\n%@", self, [self operations]) ; NSLog(@"#2 Remaining operations in %p:\n%@", self, [self op