• 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: Pausing and terminating a thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pausing and terminating a thread


  • Subject: Re: Pausing and terminating a thread
  • From: Steve Weller <email@hidden>
  • Date: Mon, 29 Aug 2005 23:23:08 -0700


So I can use a lock to implement the pause -- neat. Just acquire the lock in my main thread and that will stop the worker thread from continuing until I release it.


However this still requires that my worker thread poll. And doesn't take care of quitting the worker thread. Any better way?


On Aug 29, 2005, at 11:14 PM, j o a r wrote:


On 30 aug 2005, at 08.08, Steve Weller wrote:


I have implemented pausing and terminating in a worker thread (NSThread) by polling a state variable updated by the main thread and acting accordingly. This works fine, but is there a way to make the worker thread pause/continue or exit from my main thread so I don't have to do the polling?


NSConditionLock?

j o a r





-- Watch me learn Cocoa http://homepage.mac.com/bagelturf/



_______________________________________________
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: Pausing and terminating a thread
      • From: j o a r <email@hidden>
References: 
 >Pausing and terminating a thread (From: Steve Weller <email@hidden>)
 >Re: Pausing and terminating a thread (From: j o a r <email@hidden>)

  • Prev by Date: Re: Pausing and terminating a thread
  • Next by Date: Problem with converting an NSImage to grayscale
  • Previous by thread: Re: Pausing and terminating a thread
  • Next by thread: Re: Pausing and terminating a thread
  • Index(es):
    • Date
    • Thread