Singleton: Difference between revisions

→‎{{header|C#}}: syntax highlighting corrected
(→‎{{header|C#}}: syntax highlighting corrected)
Line 273:
 
=={{header|C#}}==
<lang C#>
Thread save singleton implementation.
To make it non thread safe remove lockObject and the lock() statement
 
<lang C#csharp>
// Usage: Singleton.Instance.SomeMethod()
class Singleton
Anonymous user