Module: Mesa Branch: main Commit: df242a2c061f4646e612040f3ac11d8a3402d655 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=df242a2c061f4646e612040f3ac11d8a3402d655
Author: Yonggang Luo <[email protected]> Date: Tue Jun 21 17:27:07 2022 +0800 auxiliary: Remove pipe_tsd Signed-off-by: Yonggang Luo <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213> --- src/gallium/auxiliary/os/os_thread.h | 44 ------------------------------------ 1 file changed, 44 deletions(-) diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h index 7ca65a21dd0..57e54015a62 100644 --- a/src/gallium/auxiliary/os/os_thread.h +++ b/src/gallium/auxiliary/os/os_thread.h @@ -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_ */
