gallium/util: replace pipe_thread_setname() with u_thread_setname()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 8 Mar 2017 23:07:43 +0000 (10:07 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 12 Mar 2017 06:49:04 +0000 (17:49 +1100)
They do the same thing we just moved the function to be
accessible to all of Mesa.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/os/os_thread.h
src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/state_trackers/nine/nine_state.c

index ecd8f8a5e979713df04f5073824a56e194630daf..b6e0698da617bdb16f780c07ce1c7348d5b4d118 100644 (file)
 #include "util/u_thread.h"
 
 
-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;
-}
-
-
 static inline int pipe_thread_is_self( thrd_t thread )
 {
 #if defined(HAVE_PTHREAD)
index d746778e25f104db866959f2bb1888c4d7fde6a4..b25ade3d2ecf4f96cfc77e1c357925eedb2f2110 100644 (file)
@@ -791,7 +791,7 @@ thread_function(void *init_data)
    unsigned fpstate;
 
    util_snprintf(thread_name, sizeof thread_name, "llvmpipe-%u", task->thread_index);
-   pipe_thread_setname(thread_name);
+   u_thread_setname(thread_name);
 
    /* Make sure that denorms are treated like zeros. This is 
     * the behavior required by D3D10. OpenGL doesn't care.
index ef33942a62a23863fa0905850720c9feecdb16ad..26c21f29f72044d81431047941e51bd4f6c77712 100644 (file)
@@ -95,7 +95,7 @@ nine_csmt_worker(void *arg)
     struct csmt_instruction *instr;
     DBG("CSMT worker spawned\n");
 
-    pipe_thread_setname("CSMT-Worker");
+    u_thread_setname("CSMT-Worker");
 
     while (1) {
         nine_queue_wait_flush(ctx->pool);
@@ -158,7 +158,7 @@ nine_csmt_create( struct NineDevice9 *This )
     (void) mtx_init(&ctx->thread_resume, mtx_plain);
 
 #if DEBUG
-    pipe_thread_setname("Main thread");
+    u_thread_setname("Main thread");
 #endif
 
     ctx->device = This;