summaryrefslogtreecommitdiff
path: root/src/vm/appdomain.cpp
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@users.noreply.github.com>2018-08-12 18:35:48 -0700
committerJan Kotas <jkotas@microsoft.com>2018-08-12 18:35:48 -0700
commit3a56afe6de4113c83b66a5d3a467b8accfaafa1f (patch)
treef10824483e72490f493f69ae50abd9f9b3ac0dcf /src/vm/appdomain.cpp
parent4ccd7a52827a9078b35e167bea488b3389538e92 (diff)
downloadcoreclr-3a56afe6de4113c83b66a5d3a467b8accfaafa1f.tar.gz
coreclr-3a56afe6de4113c83b66a5d3a467b8accfaafa1f.tar.bz2
coreclr-3a56afe6de4113c83b66a5d3a467b8accfaafa1f.zip
Fix a couple of apartment state issues (#19384)
* Fix a couple of apartment state issues Fix for https://github.com/dotnet/coreclr/issues/17822 - The apartment state now defaults to MTA for the main thread along with a CoInitialize - Calling `Thread.SetApartmentState` with STA now fails as expected (different behavior from previous netcore, same behavior as netfx) Fix for https://github.com/dotnet/coreclr/issues/17787 - `WaitHandle.WaitAll` for multiple handles is not supported on an STA thread due to issues described in https://github.com/dotnet/coreclr/issues/17787#issuecomment-385117537 - It now throws `NotSupportedException` as expected (different behavior from previous netcore, same behavior as netfx) Fix for https://github.com/dotnet/coreclr/issues/19225 * Temporarily exclude invalid CoreFX test
Diffstat (limited to 'src/vm/appdomain.cpp')
-rw-r--r--src/vm/appdomain.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp
index 47aeb103eb..63d077e4ff 100644
--- a/src/vm/appdomain.cpp
+++ b/src/vm/appdomain.cpp
@@ -3074,8 +3074,9 @@ void SystemDomain::SetThreadAptState (Thread::ApartmentState state)
Thread::ApartmentState pState = pThread->SetApartment(Thread::AS_InSTA, TRUE);
_ASSERTE(pState == Thread::AS_InSTA);
}
- else if (state == Thread::AS_InMTA)
+ else
{
+ // If an apartment state was not explicitly requested, default to MTA
Thread::ApartmentState pState = pThread->SetApartment(Thread::AS_InMTA, TRUE);
_ASSERTE(pState == Thread::AS_InMTA);
}