8230350: Shenandoah: Assertion failed when GC is cancelled by a worker thread

Reviewed-by: rkennke
This commit is contained in:
Zhengyu Gu 2019-09-17 08:22:14 -04:00
parent 4fb41f2617
commit f88c32f6f6

View File

@ -1920,7 +1920,7 @@ bool ShenandoahHeap::try_cancel_gc() {
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());