Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
GeneralRe: Umm.. Stupid Question Pin
Rocky Moore21-Jul-03 16:01
Rocky Moore21-Jul-03 16:01 
GeneralRe: Umm.. Stupid Question Pin
James T. Johnson21-Jul-03 16:12
James T. Johnson21-Jul-03 16:12 
GeneralRe: Umm.. Stupid Question Pin
Rocky Moore21-Jul-03 17:25
Rocky Moore21-Jul-03 17:25 
GeneralRe: Umm.. Stupid Question Pin
Nick Parker21-Jul-03 18:01
protectorNick Parker21-Jul-03 18:01 
GeneralRe: Umm.. Stupid Question Pin
Rocky Moore21-Jul-03 21:48
Rocky Moore21-Jul-03 21:48 
GeneralRe: Umm.. Stupid Question Pin
Nick Parker21-Jul-03 17:14
protectorNick Parker21-Jul-03 17:14 
GeneralRe: Umm.. Stupid Question Pin
J. Dunlap21-Jul-03 17:44
J. Dunlap21-Jul-03 17:44 
GeneralRe: Umm.. Stupid Question Pin
Kannan Kalyanaraman21-Jul-03 19:32
Kannan Kalyanaraman21-Jul-03 19:32 
get
{   
   if( instance == null)
   {        lock( lockObject) 
               {          
                   if( instance == null )  
                   {       
                       instance = new A();          
                   }         
               }      
   }
}


James, in the above code, why do you have to check for null two times, isn't that because of the threading issue, like before locking up the object if some other thread has accessed the property thus creating an instance Unsure | :~


thanks,
Kannan Smile | :)
GeneralRe: Umm.. Stupid Question Pin
James T. Johnson21-Jul-03 19:38
James T. Johnson21-Jul-03 19:38 
GeneralRe: Umm.. Stupid Question Pin
Kannan Kalyanaraman21-Jul-03 20:08
Kannan Kalyanaraman21-Jul-03 20:08 
GeneralPrinting a DataGrid Pin
Mike Osbahr21-Jul-03 11:42
Mike Osbahr21-Jul-03 11:42 
GeneralRecord Types Pin
dbetting21-Jul-03 11:28
dbetting21-Jul-03 11:28 
GeneralRe: Record Types Pin
David Stone21-Jul-03 13:44
sitebuilderDavid Stone21-Jul-03 13:44 
GeneralRe: Record Types Pin
Ista21-Jul-03 17:10
Ista21-Jul-03 17:10 
GeneralRe: Record Types Pin
dbetting22-Jul-03 2:47
dbetting22-Jul-03 2:47 
GeneralEncapsulating Database in custom class Pin
sandman_max21-Jul-03 11:15
sandman_max21-Jul-03 11:15 
GeneralRe: Encapsulating Database in custom class Pin
Rocky Moore21-Jul-03 17:10
Rocky Moore21-Jul-03 17:10 
GeneralRe: Encapsulating Database in custom class Pin
sandman_max22-Jul-03 4:43
sandman_max22-Jul-03 4:43 
GeneralListView getting the Selected Item Pin
albean21-Jul-03 9:36
albean21-Jul-03 9:36 
GeneralRe: ListView getting the Selected Item Pin
draco_iii21-Jul-03 9:39
draco_iii21-Jul-03 9:39 
GeneralRe: ListView getting the Selected Item Pin
albean21-Jul-03 11:05
albean21-Jul-03 11:05 
GeneralRe: ListView getting the Selected Item Pin
David Stone21-Jul-03 13:47
sitebuilderDavid Stone21-Jul-03 13:47 
GeneralDatatables and XML Pin
draco_iii21-Jul-03 9:32
draco_iii21-Jul-03 9:32 
GeneralRe: Datatables and XML Pin
Ista21-Jul-03 17:11
Ista21-Jul-03 17:11 
GeneralDisplaying Version and Build info in my program. Pin
frogb0x21-Jul-03 9:21
frogb0x21-Jul-03 9:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.