• 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: 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

  • Follow-Ups:
    • Re: Is Apple's singleton sample code correct?
      • From: Shaun Wexler <email@hidden>
References: 
 >Re: Is Apple's singleton sample code correct? (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: Is Apple's singleton sample code correct?
  • Next by Date: Re: Is Apple's singleton sample code correct?
  • 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