Skip to content

Commit

Permalink
Revert "Replace LowLevelLock with Lock (#94991)"
Browse files Browse the repository at this point in the history
This reverts commit 3b61ad9.
  • Loading branch information
MichalStrehovsky authored Nov 21, 2023
1 parent 186cf81 commit fd5d7a0
Showing 1 changed file with 8 additions and 2 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 Lock m_Crst = new Lock();
private readonly LowLevelLock m_Crst = new LowLevelLock();
private FrozenObjectSegment m_CurrentSegment;

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

using (m_Crst.EnterScope())
m_Crst.Acquire();

try
{
Debug.Assert(type != null);
// _ASSERT(FOH_COMMIT_SIZE >= MIN_OBJECT_SIZE);
Expand Down Expand Up @@ -82,6 +84,10 @@ 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 fd5d7a0

Please sign in to comment.