Singleton: Difference between revisions

Content added Content deleted
(→‎{{header|C#}}: syntax highlighting corrected)
Line 273: Line 273:


=={{header|C#}}==
=={{header|C#}}==
<lang C#>
Thread save singleton implementation.
Thread save singleton implementation.
To make it non thread safe remove lockObject and the lock() statement
To make it non thread safe remove lockObject and the lock() statement


<lang csharp>
// Usage: Singleton.Instance.SomeMethod()
// Usage: Singleton.Instance.SomeMethod()
class Singleton
class Singleton