LocalDataStoreSlot.cs 848 B

123456789101112131415161718192021222324252627
  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.Threading;
  5. namespace System
  6. {
  7. #if PROJECTN
  8. [Internal.Runtime.CompilerServices.RelocatedType("System.Threading.Thread")]
  9. #endif
  10. public sealed class LocalDataStoreSlot
  11. {
  12. internal LocalDataStoreSlot(ThreadLocal<object?> data)
  13. {
  14. Data = data;
  15. GC.SuppressFinalize(this);
  16. }
  17. internal ThreadLocal<object?> Data { get; private set; }
  18. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA1821", Justification = "Finalizer preserved for compat, it is suppressed by the constructor.")]
  19. ~LocalDataStoreSlot()
  20. {
  21. }
  22. }
  23. }