File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
mcs/class/referencesource/mscorlib/system/text Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -438,14 +438,14 @@ public static Encoding GetEncoding(int codepage)
438
438
439
439
// Our Encoding
440
440
441
- // See if we have a hash table with our encoding in it already.
442
- if ( encodings != null )
443
- encodings . TryGetValue ( codepage , out result ) ;
444
-
445
- if ( result == null )
441
+ // Don't conflict with ourselves
442
+ lock ( InternalSyncObject )
446
443
{
447
- // Don't conflict with ourselves
448
- lock ( InternalSyncObject )
444
+ // See if we have a hash table with our encoding in it already.
445
+ if ( encodings != null )
446
+ encodings . TryGetValue ( codepage , out result ) ;
447
+
448
+ if ( result == null )
449
449
{
450
450
// Need a new hash table
451
451
// in case another thread beat us to creating the Dictionary
You can’t perform that action at this time.
0 commit comments