8004902: correctness fixes motivated by contended locking work (6607129)

Misc correctness fixes

Reviewed-by: acorn, dholmes, dice, sspitsyn
This commit is contained in:
Dave Dice 2013-01-22 05:56:42 -08:00 committed by Daniel D. Daugherty
parent 8f1dc20874
commit 98c357abf8
7 changed files with 168 additions and 152 deletions

View file

@ -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;
}