hotspot/src/share/vm/runtime/interfaceSupport.cpp
changeset 2995 d8283445992a
parent 1 489c9b5090e2
child 3261 c7d5aae8d3f7
equal deleted inserted replaced
2887:b003d950922a 2995:d8283445992a
    64   tty->print_cr("%6d  %s", _number_of_calls, header);
    64   tty->print_cr("%6d  %s", _number_of_calls, header);
    65 }
    65 }
    66 
    66 
    67 void InterfaceSupport::gc_alot() {
    67 void InterfaceSupport::gc_alot() {
    68   Thread *thread = Thread::current();
    68   Thread *thread = Thread::current();
    69   if (thread->is_VM_thread()) return; // Avoid concurrent calls
    69   if (!thread->is_Java_thread()) return; // Avoid concurrent calls
    70   // Check for new, not quite initialized thread. A thread in new mode cannot initiate a GC.
    70   // Check for new, not quite initialized thread. A thread in new mode cannot initiate a GC.
    71   JavaThread *current_thread = (JavaThread *)thread;
    71   JavaThread *current_thread = (JavaThread *)thread;
    72   if (current_thread->active_handles() == NULL) return;
    72   if (current_thread->active_handles() == NULL) return;
       
    73 
       
    74   // Short-circuit any possible re-entrant gc-a-lot attempt
       
    75   if (thread->skip_gcalot()) return;
    73 
    76 
    74   if (is_init_completed()) {
    77   if (is_init_completed()) {
    75 
    78 
    76     if (++_fullgc_alot_invocation < FullGCALotStart) {
    79     if (++_fullgc_alot_invocation < FullGCALotStart) {
    77       return;
    80       return;