NSAutoreleasePool instance should be added to all threads. (#52023)
authorAaron Robinson <arobins@microsoft.com>
Mon, 10 May 2021 20:31:39 +0000 (13:31 -0700)
committerGitHub <noreply@github.com>
Mon, 10 May 2021 20:31:39 +0000 (13:31 -0700)
commit60735c6d3f61ea93b903fd36e1656b8c2bbb4a96
tree42f31bba5d9ecf5f3da9d2a72fd63a8a7acc5b3c
parentfe14d1c9cd8efebf13b2c0db3a547eca04d616c8
NSAutoreleasePool instance should be added to all threads. (#52023)

Add an NSAutoreleasePool to all managed create threads including the Main and Finalizer.

This expands the current support where support was only added to ThreadPool threads.

New feature switch was created and the ThreadPool one was removed.
 - System.Threading.Thread.EnableAutoreleasePool

Updated AutoReleaseTest for the new scenarios.
32 files changed:
docs/workflow/trimming/feature-switches.md
src/coreclr/clr.featuredefines.props
src/coreclr/clrdefinitions.cmake
src/coreclr/vm/assembly.cpp
src/coreclr/vm/ceemain.cpp
src/coreclr/vm/corelib.h
src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h
src/coreclr/vm/finalizerthread.cpp
src/coreclr/vm/gcenv.ee.cpp
src/coreclr/vm/proftoeeinterfaceimpl.cpp
src/coreclr/vm/threads.cpp
src/coreclr/vm/threads.h
src/coreclr/vm/threadsuspend.cpp
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.OSX.xml
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
src/libraries/System.Private.CoreLib/src/System/Threading/AutoreleasePool.cs [new file with mode: 0644]
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.AutoreleasePool.OSX.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs
src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj
src/mono/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.OSX.xml [new file with mode: 0644]
src/mono/mono/metadata/class-internals.h
src/mono/mono/metadata/domain.c
src/mono/mono/metadata/gc.c
src/mono/mono/metadata/object-internals.h
src/mono/mono/metadata/object.c
src/mono/mono/metadata/threads-types.h
src/mono/mono/metadata/threads.c
src/tests/Common/CLRTest.Execute.Bash.targets
src/tests/Common/CLRTest.Execute.Batch.targets
src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs
src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.csproj