This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +28
-1
lines changed
src/System.Threading.Thread Expand file tree Collapse file tree 6 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ public static void FreeNamedDataSlot(string name) { }
6565 public System . Threading . ApartmentState GetApartmentState ( ) { throw null ; }
6666 [ System . ObsoleteAttribute ( "Thread.GetCompressedStack is no longer supported. Please use the System.Threading.CompressedStack class" ) ]
6767 public System . Threading . CompressedStack GetCompressedStack ( ) { throw null ; }
68+ public static int GetCurrentProcessorId ( ) { throw null ; }
6869 public static object GetData ( System . LocalDataStoreSlot slot ) { throw null ; }
6970 public static System . AppDomain GetDomain ( ) { throw null ; }
7071 public static int GetDomainID ( ) { throw null ; }
Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ public void SetCompressedStack(CompressedStack stack)
272272 throw new InvalidOperationException ( SR . Thread_GetSetCompressedStack_NotSupported ) ;
273273 }
274274
275+ public static int GetCurrentProcessorId ( ) => RuntimeThread . GetCurrentProcessorId ( ) ;
275276 public static AppDomain GetDomain ( ) => AppDomain . CurrentDomain ;
276277 public static int GetDomainID ( ) => GetDomain ( ) . Id ;
277278 public override int GetHashCode ( ) => ManagedThreadId ;
Original file line number Diff line number Diff line change 33 <PropertyGroup >
44 <BuildConfigurations >
55 netstandard;
6+ netcoreapp;
7+ uap;
68 </BuildConfigurations >
79 </PropertyGroup >
810</Project >
Original file line number Diff line number Diff line change 77 </PropertyGroup >
88 <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='netstandard-Debug|AnyCPU'" />
99 <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='netstandard-Release|AnyCPU'" />
10+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='netcoreapp-Debug|AnyCPU'" />
11+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='netcoreapp-Release|AnyCPU'" />
12+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='uap-Debug|AnyCPU'" />
13+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='uap-Release|AnyCPU'" />
1014 <ItemGroup >
1115 <Compile Include =" CompressedStackTests.cs" />
1216 <Compile Include =" ExceptionTests.cs" />
1317 <Compile Include =" ThreadExceptionEventArgsTests.cs" />
1418 <Compile Include =" ThreadTests.cs" />
1519 </ItemGroup >
20+ <ItemGroup Condition =" '$(TargetGroup)' != 'netstandard'" >
21+ <Compile Include =" ThreadTests.netcoreapp.cs" />
22+ </ItemGroup >
1623 <ItemGroup >
1724 <Compile Include =" $(CommonTestPath)\System\Threading\ThreadTestHelpers.cs" >
1825 <Link >CommonTest\System\Threading\ThreadPoolHelpers.cs</Link >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class DummyClass : RemoteExecutorTestBase
1818 public static string HostRunnerTest = HostRunner ;
1919 }
2020
21- public static class ThreadTests
21+ public static partial class ThreadTests
2222 {
2323 private const int UnexpectedTimeoutMilliseconds = ThreadTestHelpers . UnexpectedTimeoutMilliseconds ;
2424 private const int ExpectedTimeoutMilliseconds = ThreadTestHelpers . ExpectedTimeoutMilliseconds ;
Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the MIT license.
3+ // See the LICENSE file in the project root for more information.
4+
5+ using Xunit ;
6+
7+ namespace System . Threading . Threads . Tests
8+ {
9+ public static partial class ThreadTests
10+ {
11+ public static void GetCurrentProcessorId ( )
12+ {
13+ Assert . True ( Thread . GetCurrentProcessorId ( ) >= 0 ) ;
14+ }
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments