Skip to content

Commit

Permalink
Better variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 authored Jul 20, 2024
1 parent e80c8dd commit 996cc30
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ internal static partial class Sys
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MemfdSupported", SetLastError = true)]
private static partial int MemfdSupportedImpl();

private static volatile int _cachedResult = -1;
private static volatile int s_memfdSupported = -1;

internal static bool MemfdSupported
{
get
{
int result = Interlocked.CompareExchange(ref _cachedResult, -1, -1);
int result = Interlocked.CompareExchange(ref s_memfdSupported, -1, -1);
if (result == -1)
{
result = MemfdSupportedImpl();
Interlocked.Exchange(ref _cachedResult, result);
Interlocked.Exchange(ref s_memfdSupported, result);
}
return result == 1;
}
Expand Down

0 comments on commit 996cc30

Please sign in to comment.