Re: Synchronizing Thread Execution
Re: Synchronizing Thread Execution
- Subject: Re: Synchronizing Thread Execution
- From: leenoori <email@hidden>
- Date: Tue, 5 Dec 2006 17:37:44 +0100
El 5/12/2006, a las 17:08, Buddy Kurz escribió:
I'm wondering what the difference is between
@synchronized(myObject) {
//do stuff
}
and
{
[myLock lock];
//do stuff
[myLock unlock];
}
From the programmer's perspective there are two important differences:
1. @synchronized is Panther-and-up only
2. @synchronized has an implicit exception handler; that is, if an
exception is thrown inside the @synchronized block cleans up when you
exit the block (on throwing) whereas in the NSLock version the lock
is not cleaned up.
There may be other differences, but those are the ones I know of.
_______________________________________________
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