hotspot/src/share/vm/runtime/threadLocalStorage.hpp
changeset 32181 dee472a9b4db
parent 30764 fec48bf5a827
child 34633 2a6c7c7b30a7
equal deleted inserted replaced
32180:804ef683593b 32181:dee472a9b4db
    36 
    36 
    37 // Get raw thread id: e.g., %g7 on sparc, fs or gs on x86
    37 // Get raw thread id: e.g., %g7 on sparc, fs or gs on x86
    38 extern "C" uintptr_t _raw_thread_id();
    38 extern "C" uintptr_t _raw_thread_id();
    39 
    39 
    40 class ThreadLocalStorage : AllStatic {
    40 class ThreadLocalStorage : AllStatic {
       
    41 
       
    42  // Exported API
    41  public:
    43  public:
    42   static void    set_thread(Thread* thread);
    44   static void    set_thread(Thread* thread);
    43   static Thread* get_thread_slow();
    45   static Thread* get_thread_slow();
    44   static void    invalidate_all() { pd_invalidate_all(); }
    46   static void    invalidate_all() { pd_invalidate_all(); }
       
    47   static void    init();
       
    48   static bool    is_initialized();
    45 
    49 
    46   // Machine dependent stuff
    50   // Machine dependent stuff
    47 #ifdef TARGET_OS_ARCH_linux_x86
    51 #ifdef TARGET_OS_ARCH_linux_x86
    48 # include "threadLS_linux_x86.hpp"
    52 # include "threadLS_linux_x86.hpp"
    49 #endif
    53 #endif
    79 #endif
    83 #endif
    80 #ifdef TARGET_OS_ARCH_bsd_zero
    84 #ifdef TARGET_OS_ARCH_bsd_zero
    81 # include "threadLS_bsd_zero.hpp"
    85 # include "threadLS_bsd_zero.hpp"
    82 #endif
    86 #endif
    83 
    87 
    84 
    88 #ifndef SOLARIS
    85  public:
    89  public:
    86   // Accessor
    90   // Accessor
    87   static inline int  thread_index()              { return _thread_index; }
    91   static inline int  thread_index()              { return _thread_index; }
    88   static inline void set_thread_index(int index) { _thread_index = index; }
    92   static inline void set_thread_index(int index) { _thread_index = index; }
    89 
       
    90   // Initialization
       
    91   // Called explicitly from VMThread::activate_system instead of init_globals.
       
    92   static void init();
       
    93   static bool is_initialized();
       
    94 
    93 
    95  private:
    94  private:
    96   static int     _thread_index;
    95   static int     _thread_index;
    97 
    96 
    98   static void    generate_code_for_get_thread();
    97   static void    generate_code_for_get_thread();
    99 
    98 
   100   // Processor dependent parts of set_thread and initialization
    99   // Processor dependent parts of set_thread and initialization
   101   static void pd_set_thread(Thread* thread);
   100   static void pd_set_thread(Thread* thread);
   102   static void pd_init();
   101   static void pd_init();
       
   102 
       
   103 #endif // SOLARIS
       
   104 
   103   // Invalidate any thread cacheing or optimization schemes.
   105   // Invalidate any thread cacheing or optimization schemes.
   104   static void pd_invalidate_all();
   106   static void pd_invalidate_all();
   105 
   107 
   106 };
   108 };
   107 
   109