Threading synchronization: does a primitive exists?
Threading synchronization: does a primitive exists?
- Subject: Threading synchronization: does a primitive exists?
- From: eveningnick eveningnick <email@hidden>
- Date: Thu, 05 May 2011 16:33:05 +0300
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