user/lib/libc/src/threads/thread_info.c
/**
 * Releases all memory associated with a thread information block, and removes it from the our
 * global handle mapping.
 */
Releases all memory associated with a thread information block, and removes it from the our
global handle mapping.
Releases all memory associated with a thread information block and removes it from the our global handle mapping .
void __TIBFree(uthread_t *thread) {
    int err = mtx_lock(&gState.blocksLock);
    if(err != thrd_success) return;
    if(thread->auxInfo) {
        free(thread->auxInfo);
    }
    void *old = hashmap_delete(gState.blocks, thread);
    assert(old);
    mtx_unlock(&gState.blocksLock);
}
void __TIBFree ( uthread_t * thread ) { int err = mtx_lock ( & gState . blocksLock ) ; if ( err != thrd_success ) return ; if ( thread -> auxInfo ) { free ( thread -> auxInfo ) ; } void * old = hashmap_delete ( gState . blocks , thread ) ; assert ( old ) ; mtx_unlock ( & gState . blocksLock ) ; }
Releases all memory associated with a thread information block, and removes it from the our
 global handle mapping.
Releases all memory associated with a thread information block and removes it from the our global handle mapping .
// free its memory // remove from map (releases its memory as well)