From 5c40b8d6a87fe14ade4a7ccf0e51953e1e2bb8a4 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 21 May 2021 14:09:36 -0700 Subject: [PATCH] gallium: add pipe_thread_setname Signed-off-by: Chia-I Wu Reviewed-by: Yiwei Zhang --- src/gallium/auxiliary/os/os_thread.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h index d904764..a84ca64 100644 --- a/src/gallium/auxiliary/os/os_thread.h +++ b/src/gallium/auxiliary/os/os_thread.h @@ -46,6 +46,9 @@ #include #endif +#ifdef PIPE_OS_LINUX +#include +#endif /* pipe_thread */ @@ -85,6 +88,15 @@ static inline int pipe_thread_destroy( pipe_thread thread ) return thrd_detach( thread ); } +static inline void pipe_thread_setname( const char *name ) +{ +#ifdef PIPE_OS_LINUX + prctl(PR_SET_NAME, name, 0, 0, 0); +#else + (void)name; +#endif +} + /* pipe_mutex */