Revert "Revert "Use try lock to fix class resolution race""
Fix possible deadlock in EnsureResolved caused by interaction with
GC. Since we were sleeping while holding the mutator lock, it could
block thread suspension. This would deadlock if the thread that
had locked h_class is already suspended since we would spin forever
and not make progress.
Bug: 27417671
Bug: 30500547
Test: test-art-host ART_TEST_GC_STRESS=true
This reverts commit 69bf969c055c31a75d17ea92aeee756042678114.
(cherry picked from commit 4b0ef1c980a1f3b0201d77e33bdb2f7df12c9114)
Change-Id: If5766c2c3c8a130cbb83735cdb9970038570dafd
8 files changed