< prev index next >
src/hotspot/share/runtime/vmThread.cpp
Print this page
*** 418,429 ****
VM_Operation* safepoint_ops = NULL;
//
// Wait for VM operation
//
// use no_safepoint_check to get lock without attempting to "sneak"
! { MutexLockerEx mu_queue(VMOperationQueue_lock,
! Mutex::_no_safepoint_check_flag);
// Look for new operation
assert(_cur_vm_operation == NULL, "no current one should be executing");
_cur_vm_operation = _vm_queue->remove_next();
--- 418,428 ----
VM_Operation* safepoint_ops = NULL;
//
// Wait for VM operation
//
// use no_safepoint_check to get lock without attempting to "sneak"
! { MutexLocker mu_queue(VMOperationQueue_lock);
// Look for new operation
assert(_cur_vm_operation == NULL, "no current one should be executing");
_cur_vm_operation = _vm_queue->remove_next();
*** 447,458 ****
tty->print_cr("VM self-destructed");
exit(-1);
}
if (timedout && VMThread::no_op_safepoint_needed(false)) {
! MutexUnlockerEx mul(VMOperationQueue_lock,
! Mutex::_no_safepoint_check_flag);
// Force a safepoint since we have not had one for at least
// 'GuaranteedSafepointInterval' milliseconds. This will run all
// the clean-up processing that needs to be done regularly at a
// safepoint
SafepointSynchronize::begin();
--- 446,456 ----
tty->print_cr("VM self-destructed");
exit(-1);
}
if (timedout && VMThread::no_op_safepoint_needed(false)) {
! MutexUnlocker mul(VMOperationQueue_lock);
// Force a safepoint since we have not had one for at least
// 'GuaranteedSafepointInterval' milliseconds. This will run all
// the clean-up processing that needs to be done regularly at a
// safepoint
SafepointSynchronize::begin();
*** 519,530 ****
// that simply means the op will wait for the next major cycle of the
// VMThread - just as it would if the GC thread lost the race for
// the lock.
if (_vm_queue->peek_at_safepoint_priority()) {
// must hold lock while draining queue
! MutexLockerEx mu_queue(VMOperationQueue_lock,
! Mutex::_no_safepoint_check_flag);
safepoint_ops = _vm_queue->drain_at_safepoint_priority();
} else {
safepoint_ops = NULL;
}
} while(safepoint_ops != NULL);
--- 517,527 ----
// that simply means the op will wait for the next major cycle of the
// VMThread - just as it would if the GC thread lost the race for
// the lock.
if (_vm_queue->peek_at_safepoint_priority()) {
// must hold lock while draining queue
! MutexLocker mu_queue(VMOperationQueue_lock);
safepoint_ops = _vm_queue->drain_at_safepoint_priority();
} else {
safepoint_ops = NULL;
}
} while(safepoint_ops != NULL);
*** 557,568 ****
}
//
// Notify (potential) waiting Java thread(s) - lock without safepoint
// check so that sneaking is not possible
! { MutexLockerEx mu(VMOperationRequest_lock,
! Mutex::_no_safepoint_check_flag);
VMOperationRequest_lock->notify_all();
}
//
// We want to make sure that we get to a safepoint regularly.
--- 554,564 ----
}
//
// Notify (potential) waiting Java thread(s) - lock without safepoint
// check so that sneaking is not possible
! { MutexLockerEx mu(VMOperationRequest_lock);
VMOperationRequest_lock->notify_all();
}
//
// We want to make sure that we get to a safepoint regularly.
*** 633,643 ****
// Add VM operation to list of waiting threads. We are guaranteed not to block while holding the
// VMOperationQueue_lock, so we can block without a safepoint check. This allows vm operation requests
// to be queued up during a safepoint synchronization.
{
! VMOperationQueue_lock->lock_without_safepoint_check();
log_debug(vmthread)("Adding VM operation: %s", op->name());
bool ok = _vm_queue->add(op);
op->set_timestamp(os::javaTimeMillis());
VMOperationQueue_lock->notify();
VMOperationQueue_lock->unlock();
--- 629,639 ----
// Add VM operation to list of waiting threads. We are guaranteed not to block while holding the
// VMOperationQueue_lock, so we can block without a safepoint check. This allows vm operation requests
// to be queued up during a safepoint synchronization.
{
! VMOperationQueue_lock->lock();
log_debug(vmthread)("Adding VM operation: %s", op->name());
bool ok = _vm_queue->add(op);
op->set_timestamp(os::javaTimeMillis());
VMOperationQueue_lock->notify();
VMOperationQueue_lock->unlock();
< prev index next >