• 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: Question about Threading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about Threading


  • Subject: Re: Question about Threading
  • From: Cameron Hayne <email@hidden>
  • Date: Mon, 8 Aug 2005 10:14:51 -0400

On 8-Aug-05, at 8:39 AM, Michael Becker wrote:

I have created a (class-wide) boolean variable which the thread checks on each iteration to see whether it may continue or not. However, I get synchronizing problems: When I set that boolean variable to STOP the thread, how can I make sure that I wait until the thread has finished its current iteration and then exited?

What (in general) is the best way of doing things like that?

You want to use NSLock.
You might find it useful to look at my example project "ImageCalc" that illustrates use of NSLock:
http://hayne.net/MacDev/ImageCalc/


--
Cameron Hayne
email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Question about Threading
      • From: Chris Kane <email@hidden>
References: 
 >Question about Threading (From: Michael Becker <email@hidden>)

  • Prev by Date: Re: objc and RDBMS
  • Next by Date: Re: Converting image types and preserving EXIF.
  • Previous by thread: Question about Threading
  • Next by thread: Re: Question about Threading
  • Index(es):
    • Date
    • Thread