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: Shaun Wexler <email@hidden>
- Date: Fri, 2 Dec 2005 12:49:37 -0800
On Dec 2, 2005, at 12:46 PM, gennady wexler wrote:
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?
The superclass, if Whatsit : SKWSingletonObject
<
http://www.cocoabuilder.com/archive/message/cocoa/2004/2/13/97027>
--
Shaun Wexler
MacFOH
http://www.macfoh.com
"You can't write a good song about a whorehouse unless you' been in
one." -- Woody Guthrie
_______________________________________________
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