user/lib/libc/src/threads/c11_threadlocal.c
/**
 * Returns the value of a thread local storage slot.
 */
Returns the value of a thread local storage slot.
Returns the value of a thread local storage slot .
void *tss_get(tss_t key) {
    if(!__libc_thread_tss) return NULL;
    tss_entry_t e;
    memset(&e, 0, sizeof(e));
    e.key = key;
    void *ptr = hashmap_get(__libc_thread_tss, &e);
    if(!ptr) {
        return NULL;
    }
    tss_entry_t *found = (tss_entry_t *) ptr;
    return found->value;
}
void * tss_get ( tss_t key ) { if ( ! __libc_thread_tss ) return NULL ; tss_entry_t e ; memset ( & e , 0 , sizeof ( e ) ) ; e . key = key ; void * ptr = hashmap_get ( __libc_thread_tss , & e ) ; if ( ! ptr ) { return NULL ; } tss_entry_t * found = ( tss_entry_t * ) ptr ; return found -> value ; }
Returns the value of a thread local storage slot.
Returns the value of a thread local storage slot .
// bail if no map allocated // read value for the key // no entry // return the object