equal
deleted
inserted
replaced
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(); |