src/hotspot/share/runtime/handshake.cpp
changeset 54033 07540197d0fd
parent 53775 5d20b085d893
child 54323 846bc643f4ef
equal deleted inserted replaced
54032:ac09c2498c64 54033:07540197d0fd
   286 
   286 
   287 void HandshakeState::process_self_inner(JavaThread* thread) {
   287 void HandshakeState::process_self_inner(JavaThread* thread) {
   288   assert(Thread::current() == thread, "should call from thread");
   288   assert(Thread::current() == thread, "should call from thread");
   289   assert(!thread->is_terminated(), "should not be a terminated thread");
   289   assert(!thread->is_terminated(), "should not be a terminated thread");
   290 
   290 
   291   CautiouslyPreserveExceptionMark pem(thread);
       
   292   ThreadInVMForHandshake tivm(thread);
   291   ThreadInVMForHandshake tivm(thread);
   293   if (!_semaphore.trywait()) {
   292   if (!_semaphore.trywait()) {
   294     _semaphore.wait_with_safepoint_check(thread);
   293     _semaphore.wait_with_safepoint_check(thread);
   295   }
   294   }
   296   HandshakeOperation* op = OrderAccess::load_acquire(&_operation);
   295   HandshakeOperation* op = OrderAccess::load_acquire(&_operation);
   297   if (op != NULL) {
   296   if (op != NULL) {
       
   297     HandleMark hm(thread);
       
   298     CautiouslyPreserveExceptionMark pem(thread);
   298     // Disarm before execute the operation
   299     // Disarm before execute the operation
   299     clear_handshake(thread);
   300     clear_handshake(thread);
   300     op->do_handshake(thread);
   301     op->do_handshake(thread);
   301   }
   302   }
   302   _semaphore.signal();
   303   _semaphore.signal();