Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/jvmtiExport.cpp @ 2126:db2b0f8c1cef
6814943: getcpool001 catches more than one JvmtiThreadState problem
Summary: Mark field volatile, use membars, and change access order to close race
Reviewed-by: dcubed, dholmes
author | kamg |
---|---|
date | Tue, 11 Jan 2011 10:06:00 -0500 |
parents | 7246a374a9f2 |
children | 9afee0b9fc1d |
comparison
equal
deleted
inserted
replaced
2125:7246a374a9f2 | 2126:db2b0f8c1cef |
---|---|
2251 | 2251 |
2252 //////////////////////////////////////////////////////////////////////////////////////////////// | 2252 //////////////////////////////////////////////////////////////////////////////////////////////// |
2253 | 2253 |
2254 void JvmtiExport::cleanup_thread(JavaThread* thread) { | 2254 void JvmtiExport::cleanup_thread(JavaThread* thread) { |
2255 assert(JavaThread::current() == thread, "thread is not current"); | 2255 assert(JavaThread::current() == thread, "thread is not current"); |
2256 | 2256 MutexLocker mu(JvmtiThreadState_lock); |
2257 | 2257 |
2258 // This has to happen after the thread state is removed, which is | 2258 if (thread->jvmti_thread_state() != NULL) { |
2259 // why it is not in post_thread_end_event like its complement | 2259 // This has to happen after the thread state is removed, which is |
2260 // Maybe both these functions should be rolled into the posts? | 2260 // why it is not in post_thread_end_event like its complement |
2261 JvmtiEventController::thread_ended(thread); | 2261 // Maybe both these functions should be rolled into the posts? |
2262 JvmtiEventController::thread_ended(thread); | |
2263 } | |
2262 } | 2264 } |
2263 | 2265 |
2264 void JvmtiExport::oops_do(OopClosure* f) { | 2266 void JvmtiExport::oops_do(OopClosure* f) { |
2265 JvmtiCurrentBreakpoints::oops_do(f); | 2267 JvmtiCurrentBreakpoints::oops_do(f); |
2266 JvmtiVMObjectAllocEventCollector::oops_do_for_all_threads(f); | 2268 JvmtiVMObjectAllocEventCollector::oops_do_for_all_threads(f); |