Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public sealed class Singleton
- {
- static Singleton instance=null;
- static readonly object padlock = new object();
- Singleton()
- {
- }
- public static Singleton Instance
- {
- get
- {
- lock (padlock)
- {
- if (instance==null)
- {
- instance = new Singleton();
- }
- return instance;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement