summary refs log tree commit diff
path: root/crypto/src/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r--crypto/src/asn1/x9/X9ECParametersHolder.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/crypto/src/asn1/x9/X9ECParametersHolder.cs b/crypto/src/asn1/x9/X9ECParametersHolder.cs
index b3455709c..f0a320094 100644
--- a/crypto/src/asn1/x9/X9ECParametersHolder.cs
+++ b/crypto/src/asn1/x9/X9ECParametersHolder.cs
@@ -8,13 +8,16 @@ namespace Org.BouncyCastle.Asn1.X9
 		{
 			get
 			{
-				if (parameters == null)
-				{
-					parameters = CreateParameters();
-				}
+                lock (this)
+                {
+				    if (parameters == null)
+				    {
+					    parameters = CreateParameters();
+				    }
 
-				return parameters;
-			}
+                    return parameters;
+                }
+            }
 		}
 
 		protected abstract X9ECParameters CreateParameters();