Просмотр исходного кода

2005-05-18 Sebastien Pouliot <[email protected]>

	* CryptoConfig.cs: Changed lock pattern to second version of
	http://www.skeet.org.uk/csharp/singleton.html


svn path=/trunk/mcs/; revision=44682
Sebastien Pouliot 20 лет назад
Родитель
Сommit
f52b213aba

+ 5 - 0
mcs/class/corlib/System.Security.Cryptography/ChangeLog

@@ -1,3 +1,8 @@
+2005-05-18  Sebastien Pouliot  <[email protected]>
+
+	* CryptoConfig.cs: Changed lock pattern to second version of
+	http://www.skeet.org.uk/csharp/singleton.html
+
 2005-05-16  Sebastien Pouliot  <[email protected]>
 
 	* CryptoConfig.cs: Initialization wasn't threadsafe as the "checked" 

+ 6 - 10
mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs

@@ -437,11 +437,9 @@ public class CryptoConfig {
 		if (name == null)
 			throw new ArgumentNullException ("name");
 
-		if (algorithms == null) {
-			lock (lockObject) {
-				if (algorithms == null) {
-					Initialize ();
-				}
+		lock (lockObject) {
+			if (algorithms == null) {
+				Initialize ();
 			}
 		}
 	
@@ -560,11 +558,9 @@ public class CryptoConfig {
 		if (name == null)
 			throw new ArgumentNullException ("name");
 
-		if (oid == null) {
-			lock (lockObject) {
-				if (oid == null) {
-					Initialize ();
-				}
+		lock (lockObject) {
+			if (oid == null) {
+				Initialize ();
 			}
 		}