8041468: Field nmethod::_lock_count should be declared volatile

The jint field nmethod::_lock_count which is used in nmethodLocker::lock_nmethod and nmethodLocker::unlock_nmethod should be declared volatile (see also signature of Atomic::inc)

Reviewed-by: kvn, roland
This commit is contained in:
Tobias Hartmann 2014-04-24 09:47:34 +02:00 committed by Albert Noll
parent 26de6296e0
commit d16c89c108
3 changed files with 4 additions and 4 deletions

View file

@ -203,7 +203,7 @@ class nmethod : public CodeBlob {
// and is not made into a zombie. However, once the nmethod is made into
// a zombie, it will be locked one final time if CompiledMethodUnload
// event processing needs to be done.
jint _lock_count;
volatile jint _lock_count;
// not_entrant method removal. Each mark_sweep pass will update
// this mark to current sweep invocation count if it is seen on the