Fix code version table lock / coop GC mode switch ordering (#25129)
authorKoundinya Veluri <kouvel@users.noreply.github.com>
Fri, 14 Jun 2019 01:50:11 +0000 (18:50 -0700)
committerGitHub <noreply@github.com>
Fri, 14 Jun 2019 01:50:11 +0000 (18:50 -0700)
commit060c8a228fbe397b4207eaed2aedff7bbbf32586
tree4c026478620b3d44ddbf7178f79dc8d0bd23e43f
parent0bbdbfcdebc6771f88896d59a22386fc5a18b7dd
Fix code version table lock / coop GC mode switch ordering (#25129)

Fixes https://github.com/dotnet/coreclr/issues/25086
- The lock is taken inside other unsafe locks in coop mode, in some paths it may not be legal to switch to preemptive mode before taking the lock
- Iterating over the cross loader allocator hash table to backpatch entry point slots needs coop GC mode, and was being done inside the lock
- Moved the switch to coop GC mode to before acquiring the lock to maintain consistent ordering between the two
src/vm/codeversion.cpp
src/vm/tieredcompilation.cpp