6814943: getcpool001 catches more than one JvmtiThreadState problem

Mark field volatile, use membars, and change access order to close race

Reviewed-by: dcubed, dholmes
This commit is contained in:
Keith McGuigan 2011-01-11 10:06:00 -05:00
parent ae65c6240f
commit 6308eab4d5
4 changed files with 13 additions and 11 deletions

View file

@ -31,6 +31,7 @@
#include "compiler/compileBroker.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/linkResolver.hpp"
#include "jvmtifiles/jvmtiEnv.hpp"
#include "memory/oopFactory.hpp"
#include "memory/universe.inline.hpp"
#include "oops/instanceKlass.hpp"
@ -1699,7 +1700,7 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
tlab().make_parsable(true); // retire TLAB
}
if (jvmti_thread_state() != NULL) {
if (JvmtiEnv::environments_might_exist()) {
JvmtiExport::cleanup_thread(this);
}