mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8184732: Deadlock detection improvements for 'special' locks
Assert that special ranked locks cannot safepoint and allow_vm_block and remove locks from the exceptional lock list in no_safepoint_verifier. Reviewed-by: dholmes, eosterlund
This commit is contained in:
parent
8a50aa7d21
commit
98f454c9ca
7 changed files with 116 additions and 22 deletions
|
@ -354,9 +354,9 @@ void VMThread::run() {
|
|||
void VMThread::wait_for_vm_thread_exit() {
|
||||
assert(Thread::current()->is_Java_thread(), "Should be a JavaThread");
|
||||
assert(((JavaThread*)Thread::current())->is_terminated(), "Should be terminated");
|
||||
{ MutexLocker mu(VMOperationQueue_lock, Mutex::_no_safepoint_check_flag);
|
||||
{ MonitorLocker mu(VMOperationQueue_lock, Mutex::_no_safepoint_check_flag);
|
||||
_should_terminate = true;
|
||||
VMOperationQueue_lock->notify();
|
||||
mu.notify();
|
||||
}
|
||||
|
||||
// Note: VM thread leaves at Safepoint. We are not stopped by Safepoint
|
||||
|
@ -620,8 +620,8 @@ void VMThread::loop() {
|
|||
|
||||
//
|
||||
// Notify (potential) waiting Java thread(s)
|
||||
{ MutexLocker mu(VMOperationRequest_lock, Mutex::_no_safepoint_check_flag);
|
||||
VMOperationRequest_lock->notify_all();
|
||||
{ MonitorLocker mu(VMOperationRequest_lock, Mutex::_no_safepoint_check_flag);
|
||||
mu.notify_all();
|
||||
}
|
||||
|
||||
// We want to make sure that we get to a safepoint regularly
|
||||
|
@ -695,12 +695,11 @@ void VMThread::execute(VM_Operation* op) {
|
|||
// 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();
|
||||
MonitorLocker ml(VMOperationQueue_lock, Mutex::_no_safepoint_check_flag);
|
||||
log_debug(vmthread)("Adding VM operation: %s", op->name());
|
||||
_vm_queue->add(op);
|
||||
op->set_timestamp(os::javaTimeMillis());
|
||||
VMOperationQueue_lock->notify();
|
||||
VMOperationQueue_lock->unlock();
|
||||
ml.notify();
|
||||
}
|
||||
|
||||
if (!concurrent) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue