Jump to content

Singleton: Difference between revisions

m
m (→‎{{header|PureBasic}}: update with alternative version)
m (→‎{{header|C#}}: Formating)
Line 272:
}</lang>
 
=={{header|C sharp|C#}}==
A thread safe singleton implementation.
To make it non-thread safe remove lockObject and the lock() statement.
 
<lang csharp>// Usage: Singleton.Instance.SomeMethod()
// Usage: Singleton.Instance.SomeMethod()
class Singleton
{
Line 296 ⟶ 295:
}
// The rest of the methods
}</lang>
}
</lang>
 
=={{header|Erlang}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.