• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: stop a lengthy task in a thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >stop a lengthy task in a thread (From: Morphine <email@hidden>)

  • Prev by Date: Re: disk:// and help:// security problems
  • Next by Date: Re: disk:// and help:// security problems
  • Previous by thread: Re: stop a lengthy task in a thread
  • Next by thread: Textfield and s default button
  • Index(es):
    • Date
    • Thread