Thread.Windows.cs 800 B

123456789101112131415161718
  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. using System.Runtime.ConstrainedExecution;
  5. namespace System.Threading
  6. {
  7. public sealed partial class Thread
  8. {
  9. public ApartmentState GetApartmentState() => _runtimeThread.GetApartmentState();
  10. private static Exception GetApartmentStateChangeFailedException() =>
  11. new InvalidOperationException(SR.Thread_ApartmentState_ChangeFailed);
  12. private bool TrySetApartmentStateUnchecked(ApartmentState state) => _runtimeThread.TrySetApartmentState(state);
  13. public void DisableComObjectEagerCleanup() => _runtimeThread.DisableComObjectEagerCleanup();
  14. }
  15. }