mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8259068: Streamline class loader locking
Reviewed-by: dcubed, iklam
This commit is contained in:
parent
27a39c8d3f
commit
9aa5672af0
6 changed files with 47 additions and 102 deletions
|
@ -647,19 +647,18 @@ void ObjectSynchronizer::jni_exit(oop obj, Thread* THREAD) {
|
|||
// -----------------------------------------------------------------------------
|
||||
// Internal VM locks on java objects
|
||||
// standard constructor, allows locking failures
|
||||
ObjectLocker::ObjectLocker(Handle obj, Thread* thread, bool do_lock) {
|
||||
_dolock = do_lock;
|
||||
ObjectLocker::ObjectLocker(Handle obj, Thread* thread) {
|
||||
_thread = thread;
|
||||
_thread->check_for_valid_safepoint_state();
|
||||
_obj = obj;
|
||||
|
||||
if (_dolock) {
|
||||
if (_obj() != NULL) {
|
||||
ObjectSynchronizer::enter(_obj, &_lock, _thread);
|
||||
}
|
||||
}
|
||||
|
||||
ObjectLocker::~ObjectLocker() {
|
||||
if (_dolock) {
|
||||
if (_obj() != NULL) {
|
||||
ObjectSynchronizer::exit(_obj(), &_lock, _thread);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue