Skip to content

Commit dd63190

Browse files
authored
Fix a couple missing SupportedOSPlatform attributes on ThreadPool (#55148)
1 parent 1c57282 commit dd63190

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/coreclr/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ internal static bool PerformRuntimeSpecificGateActivities(int cpuUtilization)
450450
private static extern unsafe bool PostQueuedCompletionStatus(NativeOverlapped* overlapped);
451451

452452
[CLSCompliant(false)]
453+
[SupportedOSPlatform("windows")]
453454
public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) =>
454455
PostQueuedCompletionStatus(overlapped);
455456

@@ -547,6 +548,7 @@ RegisteredWaitHandle registeredWaitHandle
547548
);
548549

549550
[Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated. Please use ThreadPool.BindHandle(SafeHandle) instead.", false)]
551+
[SupportedOSPlatform("windows")]
550552
public static bool BindHandle(IntPtr osHandle)
551553
{
552554
return BindIOCompletionCallbackNative(osHandle);

src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static partial class ThreadPool
2222
public static long PendingWorkItemCount { get { throw null; } }
2323
public static int ThreadCount { get { throw null; } }
2424
[System.ObsoleteAttribute("ThreadPool.BindHandle(IntPtr) has been deprecated. Please use ThreadPool.BindHandle(SafeHandle) instead.", false)]
25+
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
2526
public static bool BindHandle(System.IntPtr osHandle) { throw null; }
2627
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
2728
public static bool BindHandle(System.Runtime.InteropServices.SafeHandle osHandle) { throw null; }
@@ -43,6 +44,7 @@ public static partial class ThreadPool
4344
public static bool SetMaxThreads(int workerThreads, int completionPortThreads) { throw null; }
4445
public static bool SetMinThreads(int workerThreads, int completionPortThreads) { throw null; }
4546
[System.CLSCompliantAttribute(false)]
47+
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
4648
public unsafe static bool UnsafeQueueNativeOverlapped(System.Threading.NativeOverlapped* overlapped) { throw null; }
4749
public static bool UnsafeQueueUserWorkItem(System.Threading.IThreadPoolWorkItem callBack, bool preferLocal) { throw null; }
4850
public static bool UnsafeQueueUserWorkItem(System.Threading.WaitCallback callBack, object? state) { throw null; }

src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Mono.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ private static unsafe void NativeOverlappedCallback(object? obj)
1919
}
2020

2121
[CLSCompliant(false)]
22+
[SupportedOSPlatform("windows")]
2223
public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped)
2324
{
2425
// OS doesn't signal handle, so do it here (CoreCLR does this assignment in ThreadPoolNative::CorPostQueuedCompletionStatus)
@@ -28,6 +29,7 @@ public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapp
2829
}
2930

3031
[Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated. Please use ThreadPool.BindHandle(SafeHandle) instead.", false)]
32+
[SupportedOSPlatform("windows")]
3133
public static bool BindHandle(IntPtr osHandle)
3234
{
3335
throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // Replaced by ThreadPoolBoundHandle.BindHandle

0 commit comments

Comments
 (0)