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

Fix a couple missing SupportedOSPlatform attributes on ThreadPool #55148

Merged
merged 1 commit into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
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 @@ -450,6 +450,7 @@ internal static bool PerformRuntimeSpecificGateActivities(int cpuUtilization)
private static extern unsafe bool PostQueuedCompletionStatus(NativeOverlapped* overlapped);

[CLSCompliant(false)]
[SupportedOSPlatform("windows")]
public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) =>
PostQueuedCompletionStatus(overlapped);

Expand Down Expand Up @@ -547,6 +548,7 @@ RegisteredWaitHandle registeredWaitHandle
);

[Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated. Please use ThreadPool.BindHandle(SafeHandle) instead.", false)]
[SupportedOSPlatform("windows")]
public static bool BindHandle(IntPtr osHandle)
{
return BindIOCompletionCallbackNative(osHandle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static partial class ThreadPool
public static long PendingWorkItemCount { get { throw null; } }
public static int ThreadCount { get { throw null; } }
[System.ObsoleteAttribute("ThreadPool.BindHandle(IntPtr) has been deprecated. Please use ThreadPool.BindHandle(SafeHandle) instead.", false)]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static bool BindHandle(System.IntPtr osHandle) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static bool BindHandle(System.Runtime.InteropServices.SafeHandle osHandle) { throw null; }
Expand All @@ -43,6 +44,7 @@ public static partial class ThreadPool
public static bool SetMaxThreads(int workerThreads, int completionPortThreads) { throw null; }
public static bool SetMinThreads(int workerThreads, int completionPortThreads) { throw null; }
[System.CLSCompliantAttribute(false)]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public unsafe static bool UnsafeQueueNativeOverlapped(System.Threading.NativeOverlapped* overlapped) { throw null; }
public static bool UnsafeQueueUserWorkItem(System.Threading.IThreadPoolWorkItem callBack, bool preferLocal) { throw null; }
public static bool UnsafeQueueUserWorkItem(System.Threading.WaitCallback callBack, object? state) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private static unsafe void NativeOverlappedCallback(object? obj)
}

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

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