Lines Matching refs:pTls
567 static void AddKeyToList( PTLS pTls ) in AddKeyToList() argument
569 if ( pTls ) in AddKeyToList()
573 pTls->pNext = g_pThreadKeyList; in AddKeyToList()
574 pTls->pPrev = NULL; in AddKeyToList()
577 g_pThreadKeyList->pPrev = pTls; in AddKeyToList()
579 g_pThreadKeyList = pTls; in AddKeyToList()
585 static void RemoveKeyFromList( PTLS pTls ) in RemoveKeyFromList() argument
587 if ( pTls ) in RemoveKeyFromList()
590 if ( pTls->pPrev ) in RemoveKeyFromList()
591 pTls->pPrev->pNext = pTls->pNext; in RemoveKeyFromList()
594 OSL_ASSERT( pTls == g_pThreadKeyList ); in RemoveKeyFromList()
595 g_pThreadKeyList = pTls->pNext; in RemoveKeyFromList()
598 if ( pTls->pNext ) in RemoveKeyFromList()
599 pTls->pNext->pPrev = pTls->pPrev; in RemoveKeyFromList()
606 PTLS pTls; in _osl_callThreadKeyCallbackOnThreadDetach() local
609 pTls = g_pThreadKeyList; in _osl_callThreadKeyCallbackOnThreadDetach()
610 while ( pTls ) in _osl_callThreadKeyCallbackOnThreadDetach()
612 if ( pTls->pfnCallback ) in _osl_callThreadKeyCallbackOnThreadDetach()
614 void *pValue = (void*)*pTls->pulPtr; in _osl_callThreadKeyCallbackOnThreadDetach()
617 pTls->pfnCallback( pValue ); in _osl_callThreadKeyCallbackOnThreadDetach()
620 pTls = pTls->pNext; in _osl_callThreadKeyCallbackOnThreadDetach()
630 PTLS pTls = (PTLS)rtl_allocateMemory( sizeof(TLS) ); in osl_createThreadKey() local
632 if ( pTls ) in osl_createThreadKey()
634 pTls->pfnCallback = pCallback; in osl_createThreadKey()
635 if (DosAllocThreadLocalMemory(1, &pTls->pulPtr) != NO_ERROR) in osl_createThreadKey()
637 rtl_freeMemory( pTls ); in osl_createThreadKey()
638 pTls = NULL; in osl_createThreadKey()
642 *pTls->pulPtr = 0; in osl_createThreadKey()
643 AddKeyToList( pTls ); in osl_createThreadKey()
647 return ((oslThreadKey)pTls); in osl_createThreadKey()
657 PTLS pTls = (PTLS)Key; in osl_destroyThreadKey() local
659 RemoveKeyFromList( pTls ); in osl_destroyThreadKey()
660 DosFreeThreadLocalMemory(pTls->pulPtr); in osl_destroyThreadKey()
661 rtl_freeMemory( pTls ); in osl_destroyThreadKey()
672 PTLS pTls = (PTLS)Key; in osl_getThreadKeyData() local
674 return ((void *) *pTls->pulPtr); in osl_getThreadKeyData()
687 PTLS pTls = (PTLS)Key; in osl_setThreadKeyData() local
691 if ( pTls->pfnCallback ) in osl_setThreadKeyData()
692 pOldData = (void*)*pTls->pulPtr; in osl_setThreadKeyData()
694 *pTls->pulPtr = (ULONG)pData; in osl_setThreadKeyData()
696 if ( fSuccess && pTls->pfnCallback && pOldData ) in osl_setThreadKeyData()
697 pTls->pfnCallback( pOldData ); in osl_setThreadKeyData()