From 305be2b70632cf9e5ba989c62ad5115b8443e4d8 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 10 Aug 2021 11:59:27 +0200 Subject: [PATCH 1/7] add missing attribute annotations --- .../ref/System.Diagnostics.Process.cs | 4 ++-- .../src/System/Diagnostics/Process.cs | 4 ++++ .../src/System/Diagnostics/ProcessThread.cs | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs index 910193c4ed0d5..f4455e9eff3ce 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -71,7 +71,7 @@ public Process() { } public long PrivateMemorySize64 { get { throw null; } } public System.TimeSpan PrivilegedProcessorTime { get { throw null; } } public string ProcessName { get { throw null; } } - public System.IntPtr ProcessorAffinity { get { throw null; } set { } } + public System.IntPtr ProcessorAffinity { [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] set { } } public bool Responding { get { throw null; } } public Microsoft.Win32.SafeHandles.SafeProcessHandle SafeHandle { get { throw null; } } public int SessionId { get { throw null; } } @@ -237,7 +237,7 @@ internal ProcessThread() { } public int Id { get { throw null; } } public int IdealProcessor { set { } } public bool PriorityBoostEnabled { get { throw null; } set { } } - public System.Diagnostics.ThreadPriorityLevel PriorityLevel { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } + public System.Diagnostics.ThreadPriorityLevel PriorityLevel { [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } public System.TimeSpan PrivilegedProcessorTime { get { throw null; } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public System.IntPtr ProcessorAffinity { set { } } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs index f0eb46b0f67e0..de0c2c9154e6f 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs @@ -528,6 +528,8 @@ public string ProcessName /// public IntPtr ProcessorAffinity { + [SupportedOSPlatform("windows")] + [SupportedOSPlatform("linux")] get { if (!_haveProcessorAffinity) @@ -537,6 +539,8 @@ public IntPtr ProcessorAffinity } return _processorAffinity; } + [SupportedOSPlatform("windows")] + [SupportedOSPlatform("linux")] set { ProcessorAffinityCore = value; diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs index e147573bc13bc..008f5f3432c51 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs @@ -88,6 +88,9 @@ public bool PriorityBoostEnabled /// public ThreadPriorityLevel PriorityLevel { + [SupportedOSPlatform("windows")] + [SupportedOSPlatform("linux")] + [SupportedOSPlatform("freebsd")] get { if (!_priorityLevel.HasValue) From 121cdfeb8de23fb8126fd94c323b78da50d5abb3 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 10 Aug 2021 11:59:38 +0200 Subject: [PATCH 2/7] remove dead code --- .../src/System/Diagnostics/ProcessManager.Unix.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Unix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Unix.cs index a4b1e171768af..5df7ece329e1d 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Unix.cs @@ -72,9 +72,5 @@ internal static void ThrowIfRemoteMachine(string machineName) throw new PlatformNotSupportedException(SR.RemoteMachinesNotSupported); } } - public static IntPtr GetMainWindowHandle(int processId) - { - throw new PlatformNotSupportedException(); // Window handle is a Windows concept - } } } From 48bbececce207f7c1996a7a9af5232de99429b07 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 10 Aug 2021 12:05:03 +0200 Subject: [PATCH 3/7] it's supported by Windows, Linux, FreeBSD and OSX-family so we simply might not need it --- .../src/System/Diagnostics/Process.UnknownUnix.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs index 46c652a7fb6a6..bf2b94e36cdae 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs @@ -20,12 +20,6 @@ public TimeSpan PrivilegedProcessorTime get { throw new PlatformNotSupportedException(); } } - /// Gets the time the associated process was started. - internal DateTime StartTimeCore - { - get { throw new PlatformNotSupportedException(); } - } - /// /// Gets the amount of time the associated process has spent utilizing the CPU. /// It is the sum of the and From 4cf41bc001a38c618b69e28f5a3166ddbbbb484f Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 10 Aug 2021 14:20:39 +0200 Subject: [PATCH 4/7] Revert "it's supported by Windows, Linux, FreeBSD and OSX-family so we simply might not need it" This reverts commit 48bbececce207f7c1996a7a9af5232de99429b07. --- .../src/System/Diagnostics/Process.UnknownUnix.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs index bf2b94e36cdae..46c652a7fb6a6 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs @@ -20,6 +20,12 @@ public TimeSpan PrivilegedProcessorTime get { throw new PlatformNotSupportedException(); } } + /// Gets the time the associated process was started. + internal DateTime StartTimeCore + { + get { throw new PlatformNotSupportedException(); } + } + /// /// Gets the amount of time the associated process has spent utilizing the CPU. /// It is the sum of the and From f10ec363e9c2aa250c60472b0791cdbf6f227eb8 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 10 Aug 2021 14:29:22 +0200 Subject: [PATCH 5/7] ProcessThread.StartTime --- .../ref/System.Diagnostics.Process.cs | 2 +- .../src/System/Diagnostics/ProcessThread.FreeBSD.cs | 10 +++------- .../src/System/Diagnostics/ProcessThread.Linux.cs | 6 +----- .../src/System/Diagnostics/ProcessThread.OSX.cs | 6 +----- .../System/Diagnostics/ProcessThread.UnknownUnix.cs | 6 +----- .../src/System/Diagnostics/ProcessThread.Windows.cs | 6 +----- .../src/System/Diagnostics/ProcessThread.cs | 8 ++++++++ 7 files changed, 16 insertions(+), 28 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs index f4455e9eff3ce..8554a1d579897 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -242,7 +242,7 @@ public int IdealProcessor { set { } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public System.IntPtr ProcessorAffinity { set { } } public System.IntPtr StartAddress { get { throw null; } } - public System.DateTime StartTime { get { throw null; } } + public System.DateTime StartTime { [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] get { throw null; } } public System.Diagnostics.ThreadState ThreadState { get { throw null; } } public System.TimeSpan TotalProcessorTime { get { throw null; } } public System.TimeSpan UserProcessorTime { get { throw null; } } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.FreeBSD.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.FreeBSD.cs index cf098ac0ef0ce..a6b17bee36fb5 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.FreeBSD.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.FreeBSD.cs @@ -23,13 +23,9 @@ private ThreadPriorityLevel PriorityLevelCore } } - /// Returns the time the associated thread was started. - public DateTime StartTime - { - // kinfo_proc has one entry per thread but ki_start seems to be same for - // all threads e.g. reflects process start. This may be re-visited later. - get { throw new PlatformNotSupportedException(); } - } + // kinfo_proc has one entry per thread but ki_start seems to be same for + // all threads e.g. reflects process start. This may be re-visited later. + private DateTime GetStartTime() => throw new PlatformNotSupportedException(); /// /// Returns the amount of time the associated thread has spent utilizing the CPU. diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Linux.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Linux.cs index 3a0f2342b3544..853c06dcdfa2c 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Linux.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Linux.cs @@ -41,11 +41,7 @@ public TimeSpan PrivilegedProcessorTime } } - /// Returns the time the associated thread was started. - public DateTime StartTime - { - get { return Process.BootTimeToDateTime(Process.TicksToTimeSpan(GetStat().starttime)); } - } + private DateTime GetStartTime() => Process.BootTimeToDateTime(Process.TicksToTimeSpan(GetStat().starttime)); /// /// Returns the amount of time the associated thread has spent utilizing the CPU. diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.OSX.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.OSX.cs index eca275a352e04..e95abff9af741 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.OSX.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.OSX.cs @@ -25,11 +25,7 @@ private ThreadPriorityLevel PriorityLevelCore /// public TimeSpan PrivilegedProcessorTime => new TimeSpan((long)GetThreadInfo().pth_system_time); - /// Returns the time the associated thread was started. - public DateTime StartTime - { - get { throw new PlatformNotSupportedException(); } // macOS does not provide a way to get this data - } + private DateTime GetStartTime() => throw new PlatformNotSupportedException(); // macOS does not provide a way to get this data /// /// Returns the amount of time the associated thread has spent using the CPU. diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.UnknownUnix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.UnknownUnix.cs index 8754ffdf5e531..6d947625ddd6b 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.UnknownUnix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.UnknownUnix.cs @@ -25,11 +25,7 @@ public TimeSpan PrivilegedProcessorTime get { throw new PlatformNotSupportedException(); } // Not available on POSIX } - /// Returns the time the associated thread was started. - public DateTime StartTime - { - get { throw new PlatformNotSupportedException(); } // Not available on POSIX - } + private DateTime GetStartTime() => throw new PlatformNotSupportedException(); // Not available on POSIX /// /// Returns the amount of time the associated thread has spent utilizing the CPU. diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Windows.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Windows.cs index f46fd604e5e21..85c96684c2bc7 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Windows.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Windows.cs @@ -124,11 +124,7 @@ public TimeSpan PrivilegedProcessorTime get { return GetThreadTimes().PrivilegedProcessorTime; } } - /// Returns the time the associated thread was started. - public DateTime StartTime - { - get { return GetThreadTimes().StartTime; } - } + private DateTime GetStartTime() => GetThreadTimes().StartTime; /// /// Returns the amount of time the associated thread has spent utilizing the CPU. diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs index 008f5f3432c51..8285b40a4cd6f 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs @@ -139,6 +139,14 @@ public ThreadWaitReason WaitReason } } + /// Returns the time the associated thread was started. + public DateTime StartTime + { + [SupportedOSPlatform("windows")] + [SupportedOSPlatform("linux")] + get => GetStartTime(); + } + /// /// Helper to check preconditions for property access. /// From 71c0fe015f51524793491daec96e93e8be27c48a Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 10 Aug 2021 16:20:17 +0200 Subject: [PATCH 6/7] address code review feedbacj --- .../ref/System.Diagnostics.Process.cs | 11 ++++++++--- .../src/System/Diagnostics/Process.cs | 6 ++---- .../src/System/Diagnostics/ProcessThread.cs | 7 +++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs index 8554a1d579897..a3ee748c889a7 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -71,7 +71,9 @@ public Process() { } public long PrivateMemorySize64 { get { throw null; } } public System.TimeSpan PrivilegedProcessorTime { get { throw null; } } public string ProcessName { get { throw null; } } - public System.IntPtr ProcessorAffinity { [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] set { } } + [System.Runtime.Versioning.SupportedOSPlatform("windows")] + [System.Runtime.Versioning.SupportedOSPlatform("linux")] + public System.IntPtr ProcessorAffinity { get { throw null; } set { } } public bool Responding { get { throw null; } } public Microsoft.Win32.SafeHandles.SafeProcessHandle SafeHandle { get { throw null; } } public int SessionId { get { throw null; } } @@ -237,12 +239,15 @@ internal ProcessThread() { } public int Id { get { throw null; } } public int IdealProcessor { set { } } public bool PriorityBoostEnabled { get { throw null; } set { } } - public System.Diagnostics.ThreadPriorityLevel PriorityLevel { [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } + [System.Runtime.Versioning.SupportedOSPlatform("windows")] + public System.Diagnostics.ThreadPriorityLevel PriorityLevel { [System.Runtime.Versioning.SupportedOSPlatform("linux")] [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] get { throw null; } set { } } public System.TimeSpan PrivilegedProcessorTime { get { throw null; } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public System.IntPtr ProcessorAffinity { set { } } public System.IntPtr StartAddress { get { throw null; } } - public System.DateTime StartTime { [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] get { throw null; } } + [System.Runtime.Versioning.SupportedOSPlatform("windows")] + [System.Runtime.Versioning.SupportedOSPlatform("linux")] + public System.DateTime StartTime { get { throw null; } } public System.Diagnostics.ThreadState ThreadState { get { throw null; } } public System.TimeSpan TotalProcessorTime { get { throw null; } } public System.TimeSpan UserProcessorTime { get { throw null; } } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs index de0c2c9154e6f..58d297728f5ca 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs @@ -526,10 +526,10 @@ public string ProcessName /// or sets which processors the threads in this process can be scheduled to run on. /// /// + [SupportedOSPlatform("windows")] + [SupportedOSPlatform("linux")] public IntPtr ProcessorAffinity { - [SupportedOSPlatform("windows")] - [SupportedOSPlatform("linux")] get { if (!_haveProcessorAffinity) @@ -539,8 +539,6 @@ public IntPtr ProcessorAffinity } return _processorAffinity; } - [SupportedOSPlatform("windows")] - [SupportedOSPlatform("linux")] set { ProcessorAffinityCore = value; diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs index 8285b40a4cd6f..7279200d64cb3 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs @@ -86,9 +86,9 @@ public bool PriorityBoostEnabled /// not an absolute level, but instead contributes to the actual thread priority by /// considering the priority class of the process. /// + [SupportedOSPlatform("windows")] public ThreadPriorityLevel PriorityLevel { - [SupportedOSPlatform("windows")] [SupportedOSPlatform("linux")] [SupportedOSPlatform("freebsd")] get @@ -99,7 +99,6 @@ public ThreadPriorityLevel PriorityLevel } return _priorityLevel.Value; } - [SupportedOSPlatform("windows")] set { PriorityLevelCore = value; @@ -140,10 +139,10 @@ public ThreadWaitReason WaitReason } /// Returns the time the associated thread was started. + [SupportedOSPlatform("windows")] + [SupportedOSPlatform("linux")] public DateTime StartTime { - [SupportedOSPlatform("windows")] - [SupportedOSPlatform("linux")] get => GetStartTime(); } From 8ad5f50b28af9ee31754b81034f924142034869f Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 10 Aug 2021 16:49:50 +0200 Subject: [PATCH 7/7] it did not work as expected --- .../ref/System.Diagnostics.Process.cs | 3 +-- .../src/System/Diagnostics/ProcessThread.cs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs index a3ee748c889a7..3221043e6b5ea 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -239,8 +239,7 @@ internal ProcessThread() { } public int Id { get { throw null; } } public int IdealProcessor { set { } } public bool PriorityBoostEnabled { get { throw null; } set { } } - [System.Runtime.Versioning.SupportedOSPlatform("windows")] - public System.Diagnostics.ThreadPriorityLevel PriorityLevel { [System.Runtime.Versioning.SupportedOSPlatform("linux")] [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] get { throw null; } set { } } + public System.Diagnostics.ThreadPriorityLevel PriorityLevel { [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } public System.TimeSpan PrivilegedProcessorTime { get { throw null; } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public System.IntPtr ProcessorAffinity { set { } } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs index 7279200d64cb3..215e67e8928d5 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs @@ -86,9 +86,9 @@ public bool PriorityBoostEnabled /// not an absolute level, but instead contributes to the actual thread priority by /// considering the priority class of the process. /// - [SupportedOSPlatform("windows")] public ThreadPriorityLevel PriorityLevel { + [SupportedOSPlatform("windows")] [SupportedOSPlatform("linux")] [SupportedOSPlatform("freebsd")] get @@ -99,6 +99,7 @@ public ThreadPriorityLevel PriorityLevel } return _priorityLevel.Value; } + [SupportedOSPlatform("windows")] set { PriorityLevelCore = value;