equal
deleted
inserted
replaced
30 volatile bool GC_locker::_needs_gc = false; |
30 volatile bool GC_locker::_needs_gc = false; |
31 volatile bool GC_locker::_doing_gc = false; |
31 volatile bool GC_locker::_doing_gc = false; |
32 |
32 |
33 void GC_locker::stall_until_clear() { |
33 void GC_locker::stall_until_clear() { |
34 assert(!JavaThread::current()->in_critical(), "Would deadlock"); |
34 assert(!JavaThread::current()->in_critical(), "Would deadlock"); |
|
35 if (PrintJNIGCStalls && PrintGCDetails) { |
|
36 ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 |
|
37 gclog_or_tty->print_cr( |
|
38 "Allocation failed. Thread \"%s\" is stalled by JNI critical section.", |
|
39 JavaThread::current()->name()); |
|
40 } |
35 MutexLocker ml(JNICritical_lock); |
41 MutexLocker ml(JNICritical_lock); |
36 // Wait for _needs_gc to be cleared |
42 // Wait for _needs_gc to be cleared |
37 while (GC_locker::needs_gc()) { |
43 while (GC_locker::needs_gc()) { |
38 JNICritical_lock->wait(); |
44 JNICritical_lock->wait(); |
39 } |
45 } |