8230350: Shenandoah: Assertion failed when GC is cancelled by a worker thread
Reviewed-by: rkennke
--- 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());