diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2018-11-16 19:08:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 19:08:29 +0100 |
commit | 488d2a70ba59c58b26aa3f4f988a42f6b8927146 (patch) | |
tree | edfa9a20628c2c8d503a17534434c7b0ac87d97a /src/vm/proftoeeinterfaceimpl.cpp | |
parent | 7f22a149708a9ad6a90b9a92b78c12a7f4ae9d41 (diff) | |
download | coreclr-488d2a70ba59c58b26aa3f4f988a42f6b8927146.tar.gz coreclr-488d2a70ba59c58b26aa3f4f988a42f6b8927146.tar.bz2 coreclr-488d2a70ba59c58b26aa3f4f988a42f6b8927146.zip |
Fix unloadability races (#21024)
* Fix LoaderAllocator::AllocateHandle
When another thread wins the race in growing the handle table, the code
was not refreshing the slotsUsed local to the new up to date value. This
was leading to overwriting / reusing a live handle.
This change fixes it.
* Embed ThreadLocalBlock in Thread
Instead of allocating ThreadLocalBlock dynamically, embed it in the
Thread. That solves race issue between thread destruction and
LoaderAllocator destruction. The ThreadLocalBlock could have been
deleted during Thread shutdown while the LoaderAllocator's destruction
would be working with it.
Diffstat (limited to 'src/vm/proftoeeinterfaceimpl.cpp')
-rw-r--r-- | src/vm/proftoeeinterfaceimpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm/proftoeeinterfaceimpl.cpp b/src/vm/proftoeeinterfaceimpl.cpp index 2238543066..6cf30c45c0 100644 --- a/src/vm/proftoeeinterfaceimpl.cpp +++ b/src/vm/proftoeeinterfaceimpl.cpp @@ -3513,7 +3513,7 @@ HRESULT ProfToEEInterfaceImpl::GetThreadStaticAddress2(ClassID classId, // // Store the result and return // - PTR_VOID pAddress = (void *)(((Thread *)threadId)->GetStaticFieldAddrNoCreate(pFieldDesc, pAppDomain)); + PTR_VOID pAddress = (void *)(((Thread *)threadId)->GetStaticFieldAddrNoCreate(pFieldDesc)); if (pAddress == NULL) { return E_INVALIDARG; |