From 39cde5beba54099e656312f1c0532df68fb4078d Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Thu, 28 Feb 2019 16:42:27 -0500 Subject: [PATCH] Fix GetApartmentState value on Unix to be Unknown (dotnet/coreclr#22928) * Fix GetApartmentState value on Unix to be Unknown The code in corefx is returning ApartmentState.Unknown on Unix. This new coreclr implementation should do the same. * Fix visibility on TrySetApartmentStateUnchecked Commit migrated from https://github.com/dotnet/coreclr/commit/0a93b5136621040b93b9f805e26e7d27d11dc955 --- .../src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs index e0845b4..feedb50 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs @@ -397,14 +397,14 @@ namespace System.Threading #if FEATURE_COMINTEROP_APARTMENT_SUPPORT (ApartmentState)GetApartmentStateNative(); #else // !FEATURE_COMINTEROP_APARTMENT_SUPPORT - ApartmentState.MTA; + ApartmentState.Unknown; #endif // FEATURE_COMINTEROP_APARTMENT_SUPPORT /// /// An unstarted thread can be marked to indicate that it will host a /// single-threaded or multi-threaded apartment. /// - public bool TrySetApartmentStateUnchecked(ApartmentState state) => + private bool TrySetApartmentStateUnchecked(ApartmentState state) => #if FEATURE_COMINTEROP_APARTMENT_SUPPORT SetApartmentStateHelper(state, false); #else // !FEATURE_COMINTEROP_APARTMENT_SUPPORT -- 2.7.4