tag:blogger.com,1999:blog-2561678868829065190.post4580091482905126329..comments2023-09-03T06:33:26.958-07:00Comments on What I learnt today: Implementing Singleton Design Pattern using C#Unknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-2561678868829065190.post-11602192658817557432013-07-10T14:13:31.384-07:002013-07-10T14:13:31.384-07:00Yes that implementation is thread safe.Yes that implementation is thread safe.Luis Tellezhttps://www.blogger.com/profile/09491594759147374567noreply@blogger.comtag:blogger.com,1999:blog-2561678868829065190.post-69758294148780290482013-02-13T13:33:41.048-08:002013-02-13T13:33:41.048-08:00Is this implementation Thread-safe?
static Single...Is this implementation Thread-safe?<br /><br />static SingletonClass _instance = null;<br />static object lockThis;<br /><br />public static SingletonClass GetInstance()<br />{<br /> lock(lockThis)<br /> {<br /> if (_instance == null)<br /> _instance = new SingletonClass();<br /> }<br /><br /> return _instance;<br />}Broken_Windowhttps://www.blogger.com/profile/01485252540288156823noreply@blogger.com