Lines Matching refs:index
15 TLSIndex index;
18 index = TlsAlloc();
21 if ((pthread_key_create(&index, NULL)) != 0)
23 index = TLS_INVALID_INDEX;
27 assert(index != TLS_INVALID_INDEX && "CreateTLSIndex(): Unable to allocate Thread Local Storage");
28 return index;
31 bool DestroyTLSIndex(TLSIndex index)
33 assert(index != TLS_INVALID_INDEX && "DestroyTLSIndex(): Invalid TLS Index");
34 if (index == TLS_INVALID_INDEX)
40 return (TlsFree(index) == TRUE);
42 return (pthread_key_delete(index) == 0);
46 bool SetTLSValue(TLSIndex index, void *value)
48 assert(index != TLS_INVALID_INDEX && "SetTLSValue(): Invalid TLS Index");
49 if (index == TLS_INVALID_INDEX)
55 return (TlsSetValue(index, value) == TRUE);
57 return (pthread_setspecific(index, value) == 0);
61 void *GetTLSValue(TLSIndex index)
63 assert(index != TLS_INVALID_INDEX && "GetTLSValue(): Invalid TLS Index");
64 if (index == TLS_INVALID_INDEX)
70 return TlsGetValue(index);
72 return pthread_getspecific(index);