Re: Re: Synchronizing Thread Execution
Re: Re: Synchronizing Thread Execution
- Subject: Re: Re: Synchronizing Thread Execution
- From: "Clark Cox" <email@hidden>
- Date: Tue, 5 Dec 2006 11:43:32 -0500
On 12/5/06, Buddy Kurz <email@hidden> wrote:
FYI: The Darwin source contains a comment that specifically says
@synchronized(nil) does nothing.
I'm wondering what the difference is between
@synchronized(myObject) {
//do stuff
}
and
{
[myLock lock];
//do stuff
[myLock unlock];
}
@synchronized(myObject)
{
foo;
}
is more like:
@try
{
[myLock lock];
foo;
}
@finally
{
[myLock unlock];
}
That is, it will be unlocked when an exception is thrown, or you
return from the current function, etc.
--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
_______________________________________________
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