typedef void destructor_func(void *);
XPTHREAD_FUNC2(pthread_key_create, pthread_key_t *, destructor_func *);
+XPTHREAD_FUNC2(pthread_setspecific, pthread_key_t, const void *);
void
ovs_mutex_init(const struct ovs_mutex *l_, int type)
#endif
void xpthread_key_create(pthread_key_t *, void (*destructor)(void *));
+void xpthread_setspecific(pthread_key_t, const void *);
void xpthread_create(pthread_t *, pthread_attr_t *, void *(*)(void *), void *);
\f
\
value = xmalloc(sizeof *value); \
*value = initial_value; \
- pthread_setspecific(NAME##_key, value); \
+ xpthread_setspecific(NAME##_key, value); \
} \
return value; \
}
NAME##_set_unsafe(TYPE value) \
{ \
TYPE old_value = NAME##_get_unsafe(); \
- pthread_setspecific(NAME##_key, value); \
+ xpthread_setspecific(NAME##_key, value); \
return old_value; \
} \
\
loop = pthread_getspecific(key);
if (!loop) {
loop = xzalloc(sizeof *loop);
- pthread_setspecific(key, loop);
+ xpthread_setspecific(key, loop);
}
return loop;
}