auxiliary: Remove pipe_tsd

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>
This commit is contained in:
Yonggang Luo 2022-06-21 17:27:07 +08:00 committed by Marge Bot
parent af1fe5c2c8
commit df242a2c06
1 changed files with 0 additions and 44 deletions

View File

@ -111,48 +111,4 @@ pipe_semaphore_wait(pipe_semaphore *sema)
mtx_unlock(&sema->mutex);
}
/*
* Thread-specific data.
*/
typedef struct {
tss_t key;
int initMagic;
} pipe_tsd;
#define PIPE_TSD_INIT_MAGIC 0xff8adc98
static inline void
pipe_tsd_init(pipe_tsd *tsd)
{
if (tss_create(&tsd->key, NULL/*free*/) != 0) {
exit(-1);
}
tsd->initMagic = PIPE_TSD_INIT_MAGIC;
}
static inline void *
pipe_tsd_get(pipe_tsd *tsd)
{
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
return tss_get(tsd->key);
}
static inline void
pipe_tsd_set(pipe_tsd *tsd, void *value)
{
if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) {
pipe_tsd_init(tsd);
}
if (tss_set(tsd->key, value) != 0) {
exit(-1);
}
}
#endif /* OS_THREAD_H_ */