changeset 58147:8a8c60853789

8235355: Shenandoah: Resolve deadlock between OOM handler and nmethod lock Reviewed-by: zgu
author rkennke
date Wed, 04 Dec 2019 21:40:08 +0100
parents 288777cf0702
children 8e76f81d057a
files src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp	Wed Dec 04 21:26:57 2019 +0100
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp	Wed Dec 04 21:40:08 2019 +0100
@@ -215,6 +215,7 @@
 
     if (nm->is_unloading()) {
       ShenandoahReentrantLocker locker(nm_data->lock());
+      ShenandoahEvacOOMScope evac_scope;
       unlink(nm);
       return;
     }
@@ -222,6 +223,7 @@
     ShenandoahReentrantLocker locker(nm_data->lock());
 
     // Heal oops and disarm
+    ShenandoahEvacOOMScope evac_scope;
     ShenandoahNMethod::heal_nmethod(nm);
     ShenandoahNMethod::disarm_nmethod(nm);
 
@@ -258,7 +260,6 @@
   }
 
   virtual void work(uint worker_id) {
-    ShenandoahEvacOOMScope evac_scope;
     ICRefillVerifierMark mark(_verifier);
     _iterator.nmethods_do(&_cl);
   }