Fri, 23 Aug 2013 10:36:34 +0200
8023457: Event based tracing framework needs a mutex for thread groups
Reviewed-by: acorn, sla
src/share/vm/runtime/mutexLocker.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/runtime/mutexLocker.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/runtime/mutexLocker.cpp Thu Aug 22 21:23:31 2013 -0700 1.2 +++ b/src/share/vm/runtime/mutexLocker.cpp Fri Aug 23 10:36:34 2013 +0200 1.3 @@ -124,13 +124,15 @@ 1.4 1.5 Mutex* Management_lock = NULL; 1.6 Monitor* Service_lock = NULL; 1.7 -Mutex* Stacktrace_lock = NULL; 1.8 +Monitor* PeriodicTask_lock = NULL; 1.9 1.10 -Monitor* JfrQuery_lock = NULL; 1.11 +#ifdef INCLUDE_TRACE 1.12 +Mutex* JfrStacktrace_lock = NULL; 1.13 Monitor* JfrMsg_lock = NULL; 1.14 Mutex* JfrBuffer_lock = NULL; 1.15 Mutex* JfrStream_lock = NULL; 1.16 -Monitor* PeriodicTask_lock = NULL; 1.17 +Mutex* JfrThreadGroups_lock = NULL; 1.18 +#endif 1.19 1.20 #define MAX_NUM_MUTEX 128 1.21 static Monitor * _mutex_array[MAX_NUM_MUTEX]; 1.22 @@ -206,7 +208,6 @@ 1.23 def(Patching_lock , Mutex , special, true ); // used for safepointing and code patching. 1.24 def(ObjAllocPost_lock , Monitor, special, false); 1.25 def(Service_lock , Monitor, special, true ); // used for service thread operations 1.26 - def(Stacktrace_lock , Mutex, special, true ); // used for JFR stacktrace database 1.27 def(JmethodIdCreation_lock , Mutex , leaf, true ); // used for creating jmethodIDs. 1.28 1.29 def(SystemDictionary_lock , Monitor, leaf, true ); // lookups done by VM thread 1.30 @@ -272,11 +273,16 @@ 1.31 def(Debug3_lock , Mutex , nonleaf+4, true ); 1.32 def(ProfileVM_lock , Monitor, special, false); // used for profiling of the VMThread 1.33 def(CompileThread_lock , Monitor, nonleaf+5, false ); 1.34 + def(PeriodicTask_lock , Monitor, nonleaf+5, true); 1.35 1.36 +#ifdef INCLUDE_TRACE 1.37 def(JfrMsg_lock , Monitor, leaf, true); 1.38 def(JfrBuffer_lock , Mutex, nonleaf+1, true); 1.39 + def(JfrThreadGroups_lock , Mutex, nonleaf+1, true); 1.40 def(JfrStream_lock , Mutex, nonleaf+2, true); 1.41 - def(PeriodicTask_lock , Monitor, nonleaf+5, true); 1.42 + def(JfrStacktrace_lock , Mutex, special, true ); 1.43 +#endif 1.44 + 1.45 } 1.46 1.47 GCMutexLocker::GCMutexLocker(Monitor * mutex) {
2.1 --- a/src/share/vm/runtime/mutexLocker.hpp Thu Aug 22 21:23:31 2013 -0700 2.2 +++ b/src/share/vm/runtime/mutexLocker.hpp Fri Aug 23 10:36:34 2013 +0200 2.3 @@ -137,13 +137,15 @@ 2.4 2.5 extern Mutex* Management_lock; // a lock used to serialize JVM management 2.6 extern Monitor* Service_lock; // a lock used for service thread operation 2.7 -extern Mutex* Stacktrace_lock; // used to guard access to the stacktrace table 2.8 +extern Monitor* PeriodicTask_lock; // protects the periodic task structure 2.9 2.10 -extern Monitor* JfrQuery_lock; // protects JFR use 2.11 +#ifdef INCLUDE_TRACE 2.12 +extern Mutex* JfrStacktrace_lock; // used to guard access to the JFR stacktrace table 2.13 extern Monitor* JfrMsg_lock; // protects JFR messaging 2.14 extern Mutex* JfrBuffer_lock; // protects JFR buffer operations 2.15 extern Mutex* JfrStream_lock; // protects JFR stream access 2.16 -extern Monitor* PeriodicTask_lock; // protects the periodic task structure 2.17 +extern Mutex* JfrThreadGroups_lock; // protects JFR access to Thread Groups 2.18 +#endif 2.19 2.20 // A MutexLocker provides mutual exclusion with respect to a given mutex 2.21 // for the scope which contains the locker. The lock is an OS lock, not