summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--crypto/src/asn1/x9/X9ECParametersHolder.cs35
1 files changed, 19 insertions, 16 deletions
diff --git a/crypto/src/asn1/x9/X9ECParametersHolder.cs b/crypto/src/asn1/x9/X9ECParametersHolder.cs
index b3455709c..dd59e9f56 100644
--- a/crypto/src/asn1/x9/X9ECParametersHolder.cs
+++ b/crypto/src/asn1/x9/X9ECParametersHolder.cs
@@ -1,22 +1,25 @@
 namespace Org.BouncyCastle.Asn1.X9
 {
-	public abstract class X9ECParametersHolder
-	{
-		private X9ECParameters parameters;
+    public abstract class X9ECParametersHolder
+    {
+        private X9ECParameters parameters;
 
-		public X9ECParameters Parameters
-		{
-			get
-			{
-				if (parameters == null)
-				{
-					parameters = CreateParameters();
-				}
+        public X9ECParameters Parameters
+        {
+            get
+            {
+                lock (this)
+                {
+                    if (parameters == null)
+                    {
+                        parameters = CreateParameters();
+                    }
 
-				return parameters;
-			}
-		}
+                    return parameters;
+                }
+            }
+        }
 
-		protected abstract X9ECParameters CreateParameters();
-	}
+        protected abstract X9ECParameters CreateParameters();
+    }
 }