Giovanni Mascellani (@giomasce) commented about libs/vkd3d/vkd3d_private.h:
+static inline bool vkd3d_tls_key_set_value(const struct vkd3d_tls_key *key, void *value) {
- return pthread_setspecific(key->key, value);
- int rc = pthread_setspecific(key->key, value);
- if (rc < 0)
- {
ERR("Failed to set TLS key value, rc %d.\n.", rc);
return false;
- }
- return true;
}
static inline void *vkd3d_tls_key_get_value(const struct vkd3d_tls_key *key) {
- /* The descriptor object cache uses this function, which means performance is too
* critical to allow use of SetLastError() and GetLastError(). */
That's wrong, as far as I can tell `pthread_getspecific()` simply doesn't offer an interface to know whether the key was valid or not.