• 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: Threading synchronization: does a primitive exists?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threading synchronization: does a primitive exists?


  • Subject: Re: Threading synchronization: does a primitive exists?
  • From: Heath Borders <email@hidden>
  • Date: Thu, 05 May 2011 08:37:23 -0500

Try NSConditionLock. Its documentation should be pretty self-explanatory.



-Heath Borders
email@hidden
Twitter: heathborders
http://heath-tech.blogspot.com



On Thu, May 5, 2011 at 8:33 AM, eveningnick eveningnick
<email@hidden> wrote:
> Hello
> I have a thread A that spawns a thread B, and should stop, waiting
> before the thread B allows thread A to continue.
>
> In Windows, in a thread A, before spawning a thread B, i would create
> a synchronization "Event" primitive in the "non signaled" mode, the
> spawn a thread B, and call WaitForSingleObject(), waiting for thread B
> to switch the "Event" into the "signaled" mode, which would release
> the WaitForSingleObject() and allow the thread A to continue to
> operate.
>
> (WaitForSingleObject() freezes the thread, until the object that it is
> waiting for - e.g., an "Event" primitive - is switched into a
> "signaled" mode).
>
> In OS X i have no idea how to do that :S I guess it is impossible to
> do the same job using mutexes? Maybe some other primitives exist?
>
> I need this _only_ for debugging, it would greatly simplify my life. I
> am well aware that this is approach is deadlock-prone.
>
> Thanks for the response if i get one
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Threading synchronization: does a primitive exists?
      • From: eveningnick eveningnick <email@hidden>
References: 
 >Threading synchronization: does a primitive exists? (From: eveningnick eveningnick <email@hidden>)

  • Prev by Date: Threading synchronization: does a primitive exists?
  • Next by Date: Re: Threading synchronization: does a primitive exists?
  • Previous by thread: Threading synchronization: does a primitive exists?
  • Next by thread: Re: Threading synchronization: does a primitive exists?
  • Index(es):
    • Date
    • Thread