Skip to content
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 @@ -36,6 +36,7 @@

using System.Diagnostics;
using System.Numerics;
using System.Threading;

namespace System.Runtime
{
Expand Down Expand Up @@ -293,9 +294,12 @@ internal static class ThunkBlocks
{
private static IntPtr[] s_currentlyMappedThunkBlocks = new IntPtr[Constants.NumThunkBlocksPerMapping];
private static int s_currentlyMappedThunkBlocksIndex = Constants.NumThunkBlocksPerMapping;
private static Lock s_lock = new Lock(useTrivialWaits: true);

public static unsafe IntPtr GetNewThunksBlock()
{
using Lock.Scope scope = s_lock.EnterScope();

IntPtr nextThunksBlock;

// Check the most recently mapped thunks block. Each mapping consists of multiple
Expand Down
Loading