Lines Matching refs:pTls

428 static void AddKeyToList( PTLS pTls )  in AddKeyToList()  argument
430 if ( pTls ) in AddKeyToList()
434 pTls->pNext = g_pThreadKeyList; in AddKeyToList()
435 pTls->pPrev = NULL; in AddKeyToList()
438 g_pThreadKeyList->pPrev = pTls; in AddKeyToList()
440 g_pThreadKeyList = pTls; in AddKeyToList()
446 static void RemoveKeyFromList( PTLS pTls ) in RemoveKeyFromList() argument
448 if ( pTls ) in RemoveKeyFromList()
451 if ( pTls->pPrev ) in RemoveKeyFromList()
452 pTls->pPrev->pNext = pTls->pNext; in RemoveKeyFromList()
455 OSL_ASSERT( pTls == g_pThreadKeyList ); in RemoveKeyFromList()
456 g_pThreadKeyList = pTls->pNext; in RemoveKeyFromList()
459 if ( pTls->pNext ) in RemoveKeyFromList()
460 pTls->pNext->pPrev = pTls->pPrev; in RemoveKeyFromList()
467 PTLS pTls; in _osl_callThreadKeyCallbackOnThreadDetach() local
471 pTls = g_pThreadKeyList; in _osl_callThreadKeyCallbackOnThreadDetach()
472 while ( pTls ) in _osl_callThreadKeyCallbackOnThreadDetach()
474 if ( pTls->pfnCallback ) in _osl_callThreadKeyCallbackOnThreadDetach()
476 void *pValue = TlsGetValue( pTls->dwIndex ); in _osl_callThreadKeyCallbackOnThreadDetach()
479 pTls->pfnCallback( pValue ); in _osl_callThreadKeyCallbackOnThreadDetach()
482 pTls = pTls->pNext; in _osl_callThreadKeyCallbackOnThreadDetach()
492 PTLS pTls = rtl_allocateMemory( sizeof(TLS) ); in osl_createThreadKey() local
494 if ( pTls ) in osl_createThreadKey()
496 pTls->pfnCallback = pCallback; in osl_createThreadKey()
497 if ( (DWORD)-1 == (pTls->dwIndex = TlsAlloc()) ) in osl_createThreadKey()
499 rtl_freeMemory( pTls ); in osl_createThreadKey()
500 pTls = NULL; in osl_createThreadKey()
503 AddKeyToList( pTls ); in osl_createThreadKey()
506 return ((oslThreadKey)pTls); in osl_createThreadKey()
516 PTLS pTls = (PTLS)Key; in osl_destroyThreadKey() local
518 RemoveKeyFromList( pTls ); in osl_destroyThreadKey()
519 TlsFree( pTls->dwIndex ); in osl_destroyThreadKey()
520 rtl_freeMemory( pTls ); in osl_destroyThreadKey()
531 PTLS pTls = (PTLS)Key; in osl_getThreadKeyData() local
533 return (TlsGetValue( pTls->dwIndex )); in osl_getThreadKeyData()
546 PTLS pTls = (PTLS)Key; in osl_setThreadKeyData() local
550 if ( pTls->pfnCallback ) in osl_setThreadKeyData()
551 pOldData = TlsGetValue( pTls->dwIndex ); in osl_setThreadKeyData()
553 fSuccess = TlsSetValue( pTls->dwIndex, pData ); in osl_setThreadKeyData()
555 if ( fSuccess && pTls->pfnCallback && pOldData ) in osl_setThreadKeyData()
556 pTls->pfnCallback( pOldData ); in osl_setThreadKeyData()