mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8004902: correctness fixes motivated by contended locking work (6607129)
Misc correctness fixes Reviewed-by: acorn, dholmes, dice, sspitsyn
This commit is contained in:
parent
8f1dc20874
commit
98c357abf8
7 changed files with 168 additions and 152 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2013, 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
|
||||
|
@ -101,10 +101,12 @@ inline intptr_t ObjectMonitor::contentions() const {
|
|||
return _count;
|
||||
}
|
||||
|
||||
// Do NOT set _count = 0. There is a race such that _count could
|
||||
// be set while inflating prior to setting _owner
|
||||
// Just use Atomic::inc/dec and assert 0 when monitor put on free list
|
||||
inline void ObjectMonitor::set_owner(void* owner) {
|
||||
_owner = owner;
|
||||
_recursions = 0;
|
||||
_count = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue