From b9c18c5f75a647811e57a603aaae84792c095568 Mon Sep 17 00:00:00 2001 From: mullerj Date: Wed, 5 Jun 2024 22:17:31 -0400 Subject: [PATCH] Updated GetSession to use lock --- src/dotnet/src/Mil.Navy.Nrl.Norm/NormSession.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dotnet/src/Mil.Navy.Nrl.Norm/NormSession.cs b/src/dotnet/src/Mil.Navy.Nrl.Norm/NormSession.cs index c2fc70a..6f24080 100644 --- a/src/dotnet/src/Mil.Navy.Nrl.Norm/NormSession.cs +++ b/src/dotnet/src/Mil.Navy.Nrl.Norm/NormSession.cs @@ -1,5 +1,4 @@ -using System.Runtime.CompilerServices; -using System.Text; +using System.Text; namespace Mil.Navy.Nrl.Norm { @@ -75,10 +74,12 @@ namespace Mil.Navy.Nrl.Norm /// /// Specifies the session to return. /// Returns a NormSession. - [MethodImpl(MethodImplOptions.Synchronized)] internal static NormSession GetSession(long handle) { - return _normSessions[handle]; + lock (_normSessions) + { + return _normSessions[handle]; + } } ///