summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/os/os_thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/os/os_thread.h')
-rw-r--r--src/gallium/auxiliary/os/os_thread.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index ff46a891fe0..e9da8954885 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -85,6 +85,17 @@ static INLINE int pipe_thread_destroy( pipe_thread thread )
return thrd_detach( thread );
}
+static INLINE void pipe_thread_setname( const char *name )
+{
+#if defined(HAVE_PTHREAD)
+# if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \
+ (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
+ pthread_setname_np(pthread_self(), name);
+# endif
+#endif
+ (void)name;
+}
+
/* pipe_mutex
*/