8230350: Shenandoah: Assertion failed when GC is cancelled by a worker thread
authorzgu
Tue, 17 Sep 2019 08:22:14 -0400
changeset 58190 9adf95692a3d
parent 58189 2f301425af62
child 58191 8a8e87e8a4fd
8230350: Shenandoah: Assertion failed when GC is cancelled by a worker thread Reviewed-by: rkennke
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Tue Sep 17 20:38:23 2019 +0800
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Tue Sep 17 08:22:14 2019 -0400
@@ -1920,7 +1920,7 @@
     else if (prev == CANCELLED) return false;
     assert(ShenandoahSuspendibleWorkers, "should not get here when not using suspendible workers");
     assert(prev == NOT_CANCELLED, "must be NOT_CANCELLED");
-    {
+    if (Thread::current()->is_Java_thread()) {
       // We need to provide a safepoint here, otherwise we might
       // spin forever if a SP is pending.
       ThreadBlockInVM sp(JavaThread::current());