File tree 1 file changed +8
-1
lines changed
src/hotspot/share/gc/shenandoah
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 29
29
#include " gc/shenandoah/shenandoahPacer.hpp"
30
30
#include " gc/shenandoah/shenandoahPhaseTimings.hpp"
31
31
#include " runtime/atomic.hpp"
32
+ #include " runtime/javaThread.inline.hpp"
32
33
#include " runtime/mutexLocker.hpp"
33
34
#include " runtime/threadSMR.hpp"
34
35
@@ -241,7 +242,13 @@ void ShenandoahPacer::pace_for_alloc(size_t words) {
241
242
// Threads that are attaching should not block at all: they are not
242
243
// fully initialized yet. Blocking them would be awkward.
243
244
// This is probably the path that allocates the thread oop itself.
244
- if (JavaThread::current ()->is_attaching_via_jni ()) {
245
+ //
246
+ // Thread which is not an active Java thread should also not block.
247
+ // This can happen during VM init when main thread is still not an
248
+ // active Java thread.
249
+ JavaThread* current = JavaThread::current ();
250
+ if (current->is_attaching_via_jni () ||
251
+ !current->is_active_Java_thread ()) {
245
252
return ;
246
253
}
247
254
You can’t perform that action at this time.
0 commit comments