• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is Apple's singleton sample code correct?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: Is Apple's singleton sample code correct? (From: gennady wexler <email@hidden>)

  • Prev by Date: Re: Is Apple's singleton sample code correct?
  • Next by Date: Re: [OT] What happened to Stepstone?
  • Previous by thread: Re: Is Apple's singleton sample code correct?
  • Next by thread: Re: Is Apple's singleton sample code correct?
  • Index(es):
    • Date
    • Thread