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:
parent
af1fe5c2c8
commit
df242a2c06
|
@ -111,48 +111,4 @@ pipe_semaphore_wait(pipe_semaphore *sema)
|
||||||
mtx_unlock(&sema->mutex);
|
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_ */
|
#endif /* OS_THREAD_H_ */
|
||||||
|
|
Loading…
Reference in New Issue