Lines Matching defs:key
805 /* Issue #25658: On platforms where native TLS key is defined in a way that
819 pthread_key_t key;
820 int fail = pthread_key_create(&key, NULL);
823 if (key > INT_MAX) {
825 pthread_key_delete(key);
829 return (int)key;
831 return -1; /* never return valid key value. */
836 PyThread_delete_key(int key)
839 pthread_key_delete(key);
844 PyThread_delete_key_value(int key)
847 pthread_setspecific(key, NULL);
852 PyThread_set_key_value(int key, void *value)
855 int fail = pthread_setspecific(key, value);
863 PyThread_get_key_value(int key)
866 return pthread_getspecific(key);
885 PyThread_tss_create(Py_tss_t *key)
887 assert(key != NULL);
888 /* If the key has been created, function is silently skipped. */
889 if (key->_is_initialized) {
893 int fail = pthread_key_create(&(key->_key), NULL);
897 key->_is_initialized = 1;
902 PyThread_tss_delete(Py_tss_t *key)
904 assert(key != NULL);
905 /* If the key has not been created, function is silently skipped. */
906 if (!key->_is_initialized) {
910 pthread_key_delete(key->_key);
911 /* pthread has not provided the defined invalid value for the key. */
912 key->_is_initialized = 0;
916 PyThread_tss_set(Py_tss_t *key, void *value)
918 assert(key != NULL);
919 int fail = pthread_setspecific(key->_key, value);
924 PyThread_tss_get(Py_tss_t *key)
926 assert(key != NULL);
927 return pthread_getspecific(key->_key);