Re: Synchronizing Thread Execution
Re: Synchronizing Thread Execution
- Subject: Re: Synchronizing Thread Execution
- From: Jim Correia <email@hidden>
- Date: Fri, 8 Dec 2006 11:27:30 -0500
On Dec 7, 2006, at 6:43 PM, Scott Ribe wrote:
From the current Objective-C Programming Language reference:
That's what I'm reading as well. It's ambiguous with regard to whether
object identity or equality is what keys the mutexes, and quite
possibly
incorrect with regard to using _cmd as the mutex.
The runtime is open source. It looks like @synchronized(mutex)
ultimately compares the mutex by identity.
If you run this code, you'll see that s1 != s2.
NSString *s1 = NSStringFromSelector(@selector
(applicationDidFinishLaunching:));
NSString *s2 = NSStringFromSelector(@selector
(applicationDidFinishLaunching:));
NSLog(@"s1 = %p, s2 = %p", s1, s2);
Documentation bug filed.
Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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