summaryrefslogtreecommitdiff
path: root/src/vm/threads.h
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2018-10-04 10:26:06 +0200
committerGitHub <noreply@github.com>2018-10-04 10:26:06 +0200
commit7559844bbe9e4230217a9a9cf4be8a857531c8c8 (patch)
treec1ad22769c0091396307d555a5959ecdc0dfed31 /src/vm/threads.h
parent11832401739148f1f1e9419cb51180ba5263a41b (diff)
downloadcoreclr-7559844bbe9e4230217a9a9cf4be8a857531c8c8.tar.gz
coreclr-7559844bbe9e4230217a9a9cf4be8a857531c8c8.tar.bz2
coreclr-7559844bbe9e4230217a9a9cf4be8a857531c8c8.zip
Enable thread statics for collectible classes (#19944)
* Enable thread statics for collectible classes This change removes checks that were preventing usage of thread statics in collectible classes and also implements all the necessary changes. The handles that hold arrays with thread statics are allocated from LoaderAllocator for collectible classes instead of using the global strong handle like in the case of non-collectible classes. The change very much mimics what is done for regular statics. This change also adds ability to reuse freed handles to the LoaderAllocator handle table. Freed handle indexes are stored into a stack and when a new handle allocation is requested, the indices from this stack are used first. Due to the code path from which the FreeTLM that in turn frees the handles is called, I had to modify the critical section flags and also refactor the handle allocation so that the actual managed array representing the handle table is allocated out of the critical section. When I was touching the code, I have also moved the code that was dealing with handles that are not stored in the LoaderAllocator handle tables out of the critical section, since there is no point in having it inside of it.
Diffstat (limited to 'src/vm/threads.h')
-rw-r--r--src/vm/threads.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vm/threads.h b/src/vm/threads.h
index dc468630f5..3f281c0274 100644
--- a/src/vm/threads.h
+++ b/src/vm/threads.h
@@ -4526,6 +4526,10 @@ public:
}
*/
+ // Called during AssemblyLoadContext teardown to clean up all structures
+ // associated with thread statics for the specific Module
+ void DeleteThreadStaticData(ModuleIndex index);
+
protected:
// Called during AD teardown to clean up any references this