hotspot/src/share/vm/utilities/decoder.cpp
changeset 19952 bc974e92f881
parent 13963 e5b53c306fb5
child 22838 82c7497fbad4
child 22234 da823d78ad65
equal deleted inserted replaced
19951:cece69b005c0 19952:bc974e92f881
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "prims/jvm.h"
    26 #include "prims/jvm.h"
    27 #include "runtime/mutexLocker.hpp"
       
    28 #include "runtime/os.hpp"
    27 #include "runtime/os.hpp"
    29 #include "utilities/decoder.hpp"
    28 #include "utilities/decoder.hpp"
    30 #include "utilities/vmError.hpp"
    29 #include "utilities/vmError.hpp"
    31 
    30 
    32 #if defined(_WINDOWS)
    31 #if defined(_WINDOWS)
    76       delete decoder;
    75       delete decoder;
    77     }
    76     }
    78     decoder = &_do_nothing_decoder;
    77     decoder = &_do_nothing_decoder;
    79   }
    78   }
    80   return decoder;
    79   return decoder;
       
    80 }
       
    81 
       
    82 inline bool DecoderLocker::is_first_error_thread() {
       
    83   return (os::current_thread_id() == VMError::get_first_error_tid());
       
    84 }
       
    85 
       
    86 DecoderLocker::DecoderLocker() :
       
    87   MutexLockerEx(DecoderLocker::is_first_error_thread() ?
       
    88                 NULL : Decoder::shared_decoder_lock(), true) {
       
    89   _decoder = is_first_error_thread() ?
       
    90     Decoder::get_error_handler_instance() : Decoder::get_shared_instance();
       
    91   assert(_decoder != NULL, "null decoder");
       
    92 }
       
    93 
       
    94 Mutex* Decoder::shared_decoder_lock() {
       
    95   assert(_shared_decoder_lock != NULL, "Just check");
       
    96   return _shared_decoder_lock;
    81 }
    97 }
    82 
    98 
    83 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath) {
    99 bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath) {
    84   assert(_shared_decoder_lock != NULL, "Just check");
   100   assert(_shared_decoder_lock != NULL, "Just check");
    85   bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
   101   bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;