hotspot/src/share/vm/runtime/thread.cpp
changeset 11637 030466036615
parent 11636 3c07b54482a5
child 11776 519643dbbefb
equal deleted inserted replaced
11636:3c07b54482a5 11637:030466036615
    31 #include "compiler/compileBroker.hpp"
    31 #include "compiler/compileBroker.hpp"
    32 #include "interpreter/interpreter.hpp"
    32 #include "interpreter/interpreter.hpp"
    33 #include "interpreter/linkResolver.hpp"
    33 #include "interpreter/linkResolver.hpp"
    34 #include "interpreter/oopMapCache.hpp"
    34 #include "interpreter/oopMapCache.hpp"
    35 #include "jvmtifiles/jvmtiEnv.hpp"
    35 #include "jvmtifiles/jvmtiEnv.hpp"
       
    36 #include "memory/gcLocker.inline.hpp"
    36 #include "memory/oopFactory.hpp"
    37 #include "memory/oopFactory.hpp"
    37 #include "memory/universe.inline.hpp"
    38 #include "memory/universe.inline.hpp"
    38 #include "oops/instanceKlass.hpp"
    39 #include "oops/instanceKlass.hpp"
    39 #include "oops/objArrayOop.hpp"
    40 #include "oops/objArrayOop.hpp"
    40 #include "oops/oop.inline.hpp"
    41 #include "oops/oop.inline.hpp"
  2276     // access error since that may block.
  2277     // access error since that may block.
  2277     thread->check_and_handle_async_exceptions(false);
  2278     thread->check_and_handle_async_exceptions(false);
  2278   }
  2279   }
  2279 }
  2280 }
  2280 
  2281 
       
  2282 // This is a variant of the normal
       
  2283 // check_special_condition_for_native_trans with slightly different
       
  2284 // semantics for use by critical native wrappers.  It does all the
       
  2285 // normal checks but also performs the transition back into
       
  2286 // thread_in_Java state.  This is required so that critical natives
       
  2287 // can potentially block and perform a GC if they are the last thread
       
  2288 // exiting the GC_locker.
       
  2289 void JavaThread::check_special_condition_for_native_trans_and_transition(JavaThread *thread) {
       
  2290   check_special_condition_for_native_trans(thread);
       
  2291 
       
  2292   // Finish the transition
       
  2293   thread->set_thread_state(_thread_in_Java);
       
  2294 
       
  2295   if (thread->do_critical_native_unlock()) {
       
  2296     ThreadInVMfromJavaNoAsyncException tiv(thread);
       
  2297     GC_locker::unlock_critical(thread);
       
  2298     thread->clear_critical_native_unlock();
       
  2299   }
       
  2300 }
       
  2301 
  2281 // We need to guarantee the Threads_lock here, since resumes are not
  2302 // We need to guarantee the Threads_lock here, since resumes are not
  2282 // allowed during safepoint synchronization
  2303 // allowed during safepoint synchronization
  2283 // Can only resume from an external suspension
  2304 // Can only resume from an external suspension
  2284 void JavaThread::java_resume() {
  2305 void JavaThread::java_resume() {
  2285   assert_locked_or_safepoint(Threads_lock);
  2306   assert_locked_or_safepoint(Threads_lock);