Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace LowLevelLock with Lock #94991

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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