1.1 --- a/src/share/vm/utilities/decoder.cpp Wed Sep 04 08:55:08 2013 -0400 1.2 +++ b/src/share/vm/utilities/decoder.cpp Fri Sep 06 08:42:42 2013 -0700 1.3 @@ -24,7 +24,6 @@ 1.4 1.5 #include "precompiled.hpp" 1.6 #include "prims/jvm.h" 1.7 -#include "runtime/mutexLocker.hpp" 1.8 #include "runtime/os.hpp" 1.9 #include "utilities/decoder.hpp" 1.10 #include "utilities/vmError.hpp" 1.11 @@ -80,6 +79,23 @@ 1.12 return decoder; 1.13 } 1.14 1.15 +inline bool DecoderLocker::is_first_error_thread() { 1.16 + return (os::current_thread_id() == VMError::get_first_error_tid()); 1.17 +} 1.18 + 1.19 +DecoderLocker::DecoderLocker() : 1.20 + MutexLockerEx(DecoderLocker::is_first_error_thread() ? 1.21 + NULL : Decoder::shared_decoder_lock(), true) { 1.22 + _decoder = is_first_error_thread() ? 1.23 + Decoder::get_error_handler_instance() : Decoder::get_shared_instance(); 1.24 + assert(_decoder != NULL, "null decoder"); 1.25 +} 1.26 + 1.27 +Mutex* Decoder::shared_decoder_lock() { 1.28 + assert(_shared_decoder_lock != NULL, "Just check"); 1.29 + return _shared_decoder_lock; 1.30 +} 1.31 + 1.32 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath) { 1.33 assert(_shared_decoder_lock != NULL, "Just check"); 1.34 bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;