# HG changeset patch # User ehelin # Date 1386573645 -3600 # Node ID eb467dfb9585dd38bbf23086628dfd5e93f04194 # Parent 4bfd5df7018914e36480a8b21f9d699e00c1c548 8029326: G1 does not check if threads gets created Reviewed-by: brutisso, jmasa, jwilhelm diff -r 4bfd5df70189 -r eb467dfb9585 hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Tue Dec 10 16:18:26 2013 -0500 +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp Mon Dec 09 08:20:45 2013 +0100 @@ -27,6 +27,7 @@ #include "gc_implementation/g1/concurrentG1RefineThread.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1HotCardCache.hpp" +#include "runtime/java.hpp" ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) : _threads(NULL), _n_threads(0), @@ -62,6 +63,10 @@ for (int i = _n_threads - 1; i >= 0; i--) { ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, worker_id_offset, i); assert(t != NULL, "Conc refine should have been created"); + if (t->osthread() == NULL) { + vm_shutdown_during_initialization("Could not create ConcurrentG1RefineThread"); + } + assert(t->cg1r() == this, "Conc refine thread should refer to this"); _threads[i] = t; next = t; diff -r 4bfd5df70189 -r eb467dfb9585 hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Tue Dec 10 16:18:26 2013 -0500 +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Dec 09 08:20:45 2013 +0100 @@ -553,6 +553,9 @@ _cmThread = new ConcurrentMarkThread(this); assert(cmThread() != NULL, "CM Thread should have been created"); assert(cmThread()->cm() != NULL, "CM Thread should refer to this cm"); + if (_cmThread->osthread() == NULL) { + vm_shutdown_during_initialization("Could not create ConcurrentMarkThread"); + } assert(CGC_lock != NULL, "Where's the CGC_lock?"); assert(_markBitMap1.covers(heap_rs), "_markBitMap1 inconsistency");