Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using SyncLock
Message
De
24/01/2011 10:43:11
 
 
À
24/01/2011 10:13:33
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01496120
Message ID:
01497190
Vues:
55
>Didn't say you made it up

I know, I was joking.

>Just thought that in case something can reset oApp.lInitialize - for whatever reason - the first test may think it's initialized and when it executes the next line it isn't anymore. ie, as long as nothing resets oApp.lInitialize, you are right.

OK, but that could happen anywhere/anytime ... IOW, after the lock as well as before it.

>But wouldn't a static initializer be more clear in this case ?
>
>private/public static Dictionary TheDictionary = LoadDataDictionary() ; // as long as LoadDataDictionary()  returns a dictionary
>


Probably ... but we don't know how Michel has implemented the LoadDataDictionary() method, he hasn't said.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform