Skip to content

Commit 081da2a

Browse files
committed
more tweaks
1 parent f311719 commit 081da2a

6 files changed

Lines changed: 207 additions & 131 deletions

File tree

src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Threading.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ internal static unsafe partial SafeWaitHandle CreateThread(
4242
[LibraryImport(Libraries.Kernel32)]
4343
internal static partial IntPtr GetCurrentThread();
4444

45+
[LibraryImport(Libraries.Kernel32, SetLastError = true)]
46+
[return: MarshalAs(UnmanagedType.Bool)]
47+
internal static partial bool SetThreadPriorityBoost(IntPtr hThread, [MarshalAs(UnmanagedType.Bool)] bool bDisablePriorityBoost);
48+
4549
internal const int DUPLICATE_SAME_ACCESS = 2;
4650

4751
[LibraryImport(Libraries.Kernel32, SetLastError = true)]

src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelFutex.Windows.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal static bool WaitOnAddressTimeout(int* address, int comparand, int milli
2828
return true;
2929
}
3030

31-
int lastError = Marshal.GetLastWin32Error();
31+
int lastError = Marshal.GetLastPInvokeError();
3232
Debug.Assert(lastError == Interop.Errors.ERROR_TIMEOUT);
3333
if (lastError == Interop.Errors.ERROR_TIMEOUT)
3434
{

0 commit comments

Comments
 (0)