Skip to content

Commit

Permalink
Replace LowLevelLock with Lock (#94991)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalStrehovsky authored Nov 21, 2023
1 parent 79e42f9 commit 3b61ad9
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal unsafe partial class FrozenObjectHeapManager
{
public static readonly FrozenObjectHeapManager Instance = new FrozenObjectHeapManager();

private readonly LowLevelLock m_Crst = new LowLevelLock();
private readonly Lock m_Crst = new Lock();
private FrozenObjectSegment m_CurrentSegment;

// Default size to reserve for a frozen segment
Expand All @@ -34,9 +34,7 @@ internal unsafe partial class FrozenObjectHeapManager
{
HalfBakedObject* obj = null;

m_Crst.Acquire();

try
using (m_Crst.EnterScope())
{
Debug.Assert(type != null);
// _ASSERT(FOH_COMMIT_SIZE >= MIN_OBJECT_SIZE);
Expand Down Expand Up @@ -84,10 +82,6 @@ internal unsafe partial class FrozenObjectHeapManager
Debug.Assert(obj != null);
}
} // end of m_Crst lock
finally
{
m_Crst.Release();
}

IntPtr result = (IntPtr)obj;

Expand Down

0 comments on commit 3b61ad9

Please sign in to comment.