Re: Problem cancelling lengthy task in secondary thread
Re: Problem cancelling lengthy task in secondary thread
- Subject: Re: Problem cancelling lengthy task in secondary thread
- From: Jörn Salewski <email@hidden>
- Date: Thu, 30 Oct 2003 14:53:39 +0100
am 30.10.2003 13:31 Uhr schrieb Alastair J.Houghton unter
email@hidden:
>
On Thursday, October 30, 2003, at 11:53 am, Jvrn Salewski wrote:
>
>
> Has anybody got an idea of what's going wrong?
>
>
> //if (! _continue) goto CANCEL;
>
> if (![_controller searchInProgress]) {
>
> goto CANCEL;
>
> }
>
>
I wonder whether CANCEL is #defined as a macro... try changing your
>
code to use lower-case and see if that fixes it.
It's no macro. Only a simple goto label/ marker to jump to.
>
(One thing that makes
>
me suspicious that this might be the problem is the fact that the code
>
you claim works has braces, whereas the code you claim doesn't,
>
doesn't.)
I tried out braces in despair, but it didn't change anything.
I was also NSLoging the _continue variable, but it's not changed until the
inner loops are done; it's apparently not a problem of checking for its
value, but setting it.
I would assume that my setter method would return immediately even if
declared simply as void instead of oneway void, since it's just about
changing a variable and not any lengthy task. However, if doing so the
button triggering this method will be highlighted until the inner search
loops are finished.
I suspect that I'm overlooking something with the DO/ multithreading stuff,
or that it has something to do with the runloop, but actually I have no
clue.
Btw _continue and [_controller searchInProgress] are not refering the same
variable.
Any other suggestions?
Yours,
JS
>
>
Kind regards,
>
>
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.