Skip to content

Instantly share code, notes, and snippets.

@JesseBuesking
Created August 8, 2013 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JesseBuesking/6189123 to your computer and use it in GitHub Desktop.
Save JesseBuesking/6189123 to your computer and use it in GitHub Desktop.
public class Singleton
{
private static readonly Lazy<Singleton> _lazy = new Lazy<Singleton>(
() => new Singleton(), LazyThreadSafetyMode.ExecutionAndPublication);
public static Singleton Instance
{
get
{
return Singleton._lazy.Value;
}
}
private Singleton
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment