mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8235678: Remove unnecessary calls to Thread::current() in MutexLocker calls
Add THREAD argument when available and make Thread* the first argument to relevant MutexLocker and MonitorLocker constructors Reviewed-by: lfoltan, coleenp, dholmes
This commit is contained in:
parent
e2240b714e
commit
7fc58a1020
36 changed files with 122 additions and 121 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -206,7 +206,7 @@ class MutexLocker: public StackObj {
|
|||
}
|
||||
}
|
||||
|
||||
MutexLocker(Mutex* mutex, Thread* thread, Mutex::SafepointCheckFlag flag = Mutex::_safepoint_check_flag) :
|
||||
MutexLocker(Thread* thread, Mutex* mutex, Mutex::SafepointCheckFlag flag = Mutex::_safepoint_check_flag) :
|
||||
_mutex(mutex) {
|
||||
bool no_safepoint_check = flag == Mutex::_no_safepoint_check_flag;
|
||||
if (_mutex != NULL) {
|
||||
|
@ -242,8 +242,8 @@ class MonitorLocker: public MutexLocker {
|
|||
assert(_monitor != NULL, "NULL monitor not allowed");
|
||||
}
|
||||
|
||||
MonitorLocker(Monitor* monitor, Thread* thread, Mutex::SafepointCheckFlag flag = Mutex::_safepoint_check_flag) :
|
||||
MutexLocker(monitor, thread, flag), _flag(flag), _monitor(monitor) {
|
||||
MonitorLocker(Thread* thread, Monitor* monitor, Mutex::SafepointCheckFlag flag = Mutex::_safepoint_check_flag) :
|
||||
MutexLocker(thread, monitor, flag), _flag(flag), _monitor(monitor) {
|
||||
// Superclass constructor did locking
|
||||
assert(_monitor != NULL, "NULL monitor not allowed");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue