Lines Matching refs:key

17 /*!	Retrieves the destructor of a key locklessly.
21 get_key_destructor(uint32 key, int32& sequence)
26 sequence = sKeyTable[key].sequence;
30 destructor = sKeyTable[key].destructor;
31 } while (sKeyTable[key].sequence != sequence);
37 /*! Function to get the thread specific value of a key in a lockless
39 \a sequence must be the sequence of the key table that this value
43 get_key_value(pthread_thread* thread, uint32 key, int32 sequence)
45 pthread_key_data& keyData = thread->specific[key];
66 for (uint32 key = 0; key < PTHREAD_KEYS_MAX; key++) {
68 pthread_key_destructor destructor = get_key_destructor(key, sequence);
69 void* value = get_key_value(thread, key, sequence);
85 for (uint32 key = 0; key < PTHREAD_KEYS_MAX; key++) {
86 int32 sequence = sKeyTable[key].sequence;
92 if (atomic_test_and_set(&sKeyTable[key].sequence, nextSequence,
96 sKeyTable[key].destructor = destructor;
97 *_key = key;
106 pthread_key_delete(pthread_key_t key)
108 if (key < 0 || key >= PTHREAD_KEYS_MAX)
111 int32 sequence = atomic_get_and_set(&sKeyTable[key].sequence,
121 pthread_getspecific(pthread_key_t key)
125 if (key < 0 || key >= PTHREAD_KEYS_MAX)
128 // check if this key is used, and our value belongs to its current meaning
129 int32 sequence = atomic_get(&sKeyTable[key].sequence);
131 || thread->specific[key].sequence != sequence)
134 return thread->specific[key].value;
139 pthread_setspecific(pthread_key_t key, const void* value)
141 if (key < 0 || key >= PTHREAD_KEYS_MAX)
144 int32 sequence = atomic_get(&sKeyTable[key].sequence);
148 pthread_key_data& keyData = pthread_self()->specific[key];