1 files changed, 6 insertions, 7 deletions
diff --git a/crypto/src/math/ec/ECCurve.cs b/crypto/src/math/ec/ECCurve.cs
index 7d60e5f99..f011b1baf 100644
--- a/crypto/src/math/ec/ECCurve.cs
+++ b/crypto/src/math/ec/ECCurve.cs
@@ -433,18 +433,17 @@ namespace Org.BouncyCastle.Math.EC
}
/**
- * Sets the default <code>ECMultiplier</code>, unless already set.
+ * Sets the default <code>ECMultiplier</code>, unless already set.
+ *
+ * We avoid locking for performance reasons, so there is no uniqueness guarantee.
*/
public virtual ECMultiplier GetMultiplier()
{
- lock (this)
+ if (this.m_multiplier == null)
{
- if (this.m_multiplier == null)
- {
- this.m_multiplier = CreateDefaultMultiplier();
- }
- return this.m_multiplier;
+ this.m_multiplier = CreateDefaultMultiplier();
}
+ return this.m_multiplier;
}
/**
|