Re: stop a lengthy task in a thread
Re: stop a lengthy task in a thread
- Subject: Re: stop a lengthy task in a thread
- From: Ondra Cada <email@hidden>
- Date: Wed, 19 May 2004 00:35:13 +0200
On 18.5.2004, at 23:32, Morphine wrote:
>
How to do for set the "stop" bool to change it's state ???
Try to declare the "stop" variable with the "volatile" modifier:
without it, the compiler might feel clever and optimize the test out.
Also, unless you do other things with the variable, you don't need to
lock the access to it at all (not speaking of the fact the actual way
you use the lock is completely worthless anyway and leaks ;)).
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.