gallium/util: replace pipe_thread with thrd_t
authorTimothy Arceri <tarceri@itsqueeze.com>
Sun, 5 Mar 2017 01:39:49 +0000 (12:39 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 6 Mar 2017 21:53:27 +0000 (08:53 +1100)
pipe_thread was made unnecessary with fd33a6bcd7f12.

V2: fix compile error in u_queue.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/os/os_thread.h
src/gallium/auxiliary/util/u_queue.c
src/gallium/auxiliary/util/u_queue.h
src/gallium/drivers/ddebug/dd_pipe.h
src/gallium/drivers/llvmpipe/lp_rast_priv.h
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/rbug/rbug_core.c
src/gallium/state_trackers/nine/nine_state.c
src/gallium/tests/unit/pipe_barrier_test.c

index a429f4eaf760a04774fedfead47fe9fac78f4fac..ad2cda431d17bef09f25ec9a8b2859ce42075523 100644 (file)
 #endif
 
 
-/* pipe_thread
- */
-typedef thrd_t pipe_thread;
-
 #define PIPE_THREAD_ROUTINE( name, param ) \
    int name( void *param )
 
-static inline pipe_thread pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), ), void *param )
+static inline thrd_t pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), ), void *param )
 {
-   pipe_thread thread;
+   thrd_t thread;
 #ifdef HAVE_PTHREAD
    sigset_t saved_set, new_set;
    int ret;
@@ -75,12 +71,12 @@ static inline pipe_thread pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), ),
    return thread;
 }
 
-static inline int pipe_thread_wait( pipe_thread thread )
+static inline int pipe_thread_wait( thrd_t thread )
 {
    return thrd_join( thread, NULL );
 }
 
-static inline int pipe_thread_destroy( pipe_thread thread )
+static inline int pipe_thread_destroy( thrd_t thread )
 {
    return thrd_detach( thread );
 }
@@ -97,7 +93,7 @@ static inline void pipe_thread_setname( const char *name )
 }
 
 
-static inline int pipe_thread_is_self( pipe_thread thread )
+static inline int pipe_thread_is_self( thrd_t thread )
 {
 #if defined(HAVE_PTHREAD)
 #  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \
@@ -307,7 +303,7 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
 
 /* Return the time of a thread's CPU time clock. */
 static inline int64_t
-pipe_thread_get_time_nano(pipe_thread thread)
+pipe_thread_get_time_nano(thrd_t thread)
 {
 #if defined(PIPE_OS_LINUX) && defined(HAVE_PTHREAD)
    struct timespec ts;
index 2525230089742eabee735d3a695c5ee7377757f9..b20abc8f45d6af3d13cc6c09887ee5bcccbf54ee 100644 (file)
@@ -216,7 +216,7 @@ util_queue_init(struct util_queue *queue,
    cnd_init(&queue->has_queued_cond);
    cnd_init(&queue->has_space_cond);
 
-   queue->threads = (pipe_thread*)CALLOC(num_threads, sizeof(pipe_thread));
+   queue->threads = (thrd_t*)CALLOC(num_threads, sizeof(thrd_t));
    if (!queue->threads)
       goto fail;
 
index 8d4804f5c6a1496bccf691626053a945a3635ab2..635545f3a658c58df41e1416af9a93cd765402e9 100644 (file)
@@ -60,7 +60,7 @@ struct util_queue {
    mtx_t lock;
    pipe_condvar has_queued_cond;
    pipe_condvar has_space_cond;
-   pipe_thread *threads;
+   thrd_t *threads;
    int num_queued;
    unsigned num_threads;
    int kill_threads;
index dc7c325885d071b5563b81c5d2124a96266a97d0..64d5510e6b821fefa6732965d974bc652c897336 100644 (file)
@@ -234,7 +234,7 @@ struct dd_context
     * their fences. Records with signalled fences are freed. On fence timeout,
     * the thread dumps the record of the oldest unsignalled fence.
     */
-   pipe_thread thread;
+   thrd_t thread;
    mtx_t mutex;
    int kill_thread;
    struct pipe_resource *fence;
index 9aa7e8746576b7ab4bd8425d5638c58ab891efe5..3cc52b8d4fdc8cfa1e2f897c15e954e664f2f89b 100644 (file)
@@ -127,7 +127,7 @@ struct lp_rasterizer
    struct lp_rasterizer_task tasks[LP_MAX_THREADS];
 
    unsigned num_threads;
-   pipe_thread threads[LP_MAX_THREADS];
+   thrd_t threads[LP_MAX_THREADS];
 
    /** For synchronizing the rasterization threads */
    pipe_barrier barrier;
index 726dbb30fcdde78e061850f6317d6de088480897..35168844fbf12d88e10327be31d03a6560adc267 100644 (file)
@@ -395,7 +395,7 @@ struct r600_common_screen {
 
        /* GPU load thread. */
        mtx_t                           gpu_load_mutex;
-       pipe_thread                     gpu_load_thread;
+       thrd_t                          gpu_load_thread;
        union r600_mmio_counters        mmio_counters;
        volatile unsigned               gpu_load_stop_thread; /* bool */
 
index b3082da58391745beb920616234fe551e9f38b1f..a5d3ee49ce476d7dfa3555de9415cb9b54970dd3 100644 (file)
@@ -54,7 +54,7 @@ struct rbug_rbug
 {
    struct rbug_screen *rb_screen;
    struct rbug_connection *con;
-   pipe_thread thread;
+   thrd_t thread;
    boolean running;
 };
 
index c3483e4c24fde0a6ae23673e5096a357fb62c2ed..bfceeeefeac0d772e5e609252fb5f5de28b03f43 100644 (file)
@@ -60,7 +60,7 @@ struct csmt_instruction {
 };
 
 struct csmt_context {
-    pipe_thread worker;
+    thrd_t worker;
     struct nine_queue_pool* pool;
     BOOL terminate;
     pipe_condvar event_processed;
@@ -217,7 +217,7 @@ void
 nine_csmt_destroy( struct NineDevice9 *device, struct csmt_context *ctx )
 {
     struct csmt_instruction* instr;
-    pipe_thread render_thread = ctx->worker;
+    thrd_t render_thread = ctx->worker;
 
     DBG("device=%p ctx=%p\n", device, ctx);
 
index bb7989a79fd48dc756044368551ce1b81eaed0d8..d5d7fb747af9eb3a57e93c61dff7a91f30d401d6 100644 (file)
@@ -46,7 +46,7 @@
 
 static int verbosity = 0;
 
-static pipe_thread threads[NUM_THREADS];
+static thrd_t threads[NUM_THREADS];
 static pipe_barrier barrier;
 static int thread_ids[NUM_THREADS];