Re: Is Apple's singleton sample code correct?
Re: Is Apple's singleton sample code correct?
- Subject: Re: Is Apple's singleton sample code correct?
- From: gennady wexler <email@hidden>
- Date: Fri, 02 Dec 2005 12:46:14 -0800
- Thread-topic: Is Apple's singleton sample code correct?
On 12/2/05 12:31 PM, "Shaun Wexler" <email@hidden> wrote:
>
+ (void)sharedWhatsit
>
{
>
static Whatsit *sharedWhatsit = nil;
>
>
if (sharedWhatsit == nil) {
>
sharedWhatsit = [Whatsit sharedInstance]; // thread-safe accessor!
>
}
>
>
return sharedWhatsit;
What makes this a thread-safe accessor?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden