Top


定義場所(file name)

hotspot/src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp

名前(function name)

void ThreadLocalStorage::set_thread_in_slot(Thread *thread) {

本体部(body)

      guarantee (tlsMode != pd_tlsAccessUndefined, "tlsMode not set") ;
      if (tlsMode == pd_tlsAccessIndirect) {
    #ifdef AMD64
            intptr_t tbase = fs_thread();
    #else
            intptr_t tbase = gs_thread();
    #endif // AMD64
            *((Thread**) (tbase + tlsOffset)) = thread ;
      } else
      if (tlsMode == pd_tlsAccessDirect) {
            thr_setspecific (tlsKey, (void *) thread) ;
            // set with thr_setspecific and then readback with gs_load to validate.
    #ifdef AMD64
            guarantee (thread == fs_load(tlsOffset), "tls readback failure") ;
    #else
            guarantee (thread == gs_load(tlsOffset), "tls readback failure") ;
    #endif // AMD64
      }
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.