Mesa (master): gallium/util: replace pipe_thread_wait() with thrd_join()

Timothy Arceri tarceri at kemper.freedesktop.org
Mon Mar 6 22:14:01 UTC 2017


Module: Mesa
Branch: master
Commit: d82d8be6148b599ce47bf4c0e6ae4e27cf5cc233
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d82d8be6148b599ce47bf4c0e6ae4e27cf5cc233

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Mon Mar  6 11:58:27 2017 +1100

gallium/util: replace pipe_thread_wait() with thrd_join()

Replace done using:
find ./src -type f -exec sed -i -- \
's:pipe_thread_wait(\([^)]*\)):thrd_join(\1, NULL):g' {} \;

Reviewed-by: Plamena Manolova <plamena.manolova at intel.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/auxiliary/os/os_thread.h         | 5 -----
 src/gallium/auxiliary/util/u_queue.c         | 2 +-
 src/gallium/drivers/ddebug/dd_context.c      | 2 +-
 src/gallium/drivers/llvmpipe/lp_rast.c       | 2 +-
 src/gallium/drivers/radeon/r600_gpu_load.c   | 2 +-
 src/gallium/drivers/rbug/rbug_core.c         | 2 +-
 src/gallium/state_trackers/nine/nine_state.c | 2 +-
 src/gallium/tests/unit/pipe_barrier_test.c   | 2 +-
 8 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index bb767fa..2aad3e2 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -68,11 +68,6 @@ static inline thrd_t pipe_thread_create(int (*routine)(void *), void *param)
    return thread;
 }
 
-static inline int pipe_thread_wait( thrd_t thread )
-{
-   return thrd_join( thread, NULL );
-}
-
 static inline int pipe_thread_destroy( thrd_t thread )
 {
    return thrd_detach( thread );
diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c
index a3aed29..9565c53 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -272,7 +272,7 @@ util_queue_killall_and_wait(struct util_queue *queue)
    mtx_unlock(&queue->lock);
 
    for (i = 0; i < queue->num_threads; i++)
-      pipe_thread_wait(queue->threads[i]);
+      thrd_join(queue->threads[i], NULL);
    queue->num_threads = 0;
 }
 
diff --git a/src/gallium/drivers/ddebug/dd_context.c b/src/gallium/drivers/ddebug/dd_context.c
index a52975d..eae128a 100644
--- a/src/gallium/drivers/ddebug/dd_context.c
+++ b/src/gallium/drivers/ddebug/dd_context.c
@@ -597,7 +597,7 @@ dd_context_destroy(struct pipe_context *_pipe)
       mtx_lock(&dctx->mutex);
       dctx->kill_thread = 1;
       mtx_unlock(&dctx->mutex);
-      pipe_thread_wait(dctx->thread);
+      thrd_join(dctx->thread, NULL);
       mtx_destroy(&dctx->mutex);
       assert(!dctx->records);
    }
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 2f222d0..678ef0b 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -956,7 +956,7 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
 #ifdef _WIN32
       pipe_semaphore_wait(&rast->tasks[i].work_done);
 #else
-      pipe_thread_wait(rast->threads[i]);
+      thrd_join(rast->threads[i], NULL);
 #endif
    }
 
diff --git a/src/gallium/drivers/radeon/r600_gpu_load.c b/src/gallium/drivers/radeon/r600_gpu_load.c
index df43a6e..1b51af4 100644
--- a/src/gallium/drivers/radeon/r600_gpu_load.c
+++ b/src/gallium/drivers/radeon/r600_gpu_load.c
@@ -170,7 +170,7 @@ void r600_gpu_load_kill_thread(struct r600_common_screen *rscreen)
 		return;
 
 	p_atomic_inc(&rscreen->gpu_load_stop_thread);
-	pipe_thread_wait(rscreen->gpu_load_thread);
+	thrd_join(rscreen->gpu_load_thread, NULL);
 	rscreen->gpu_load_thread = 0;
 }
 
diff --git a/src/gallium/drivers/rbug/rbug_core.c b/src/gallium/drivers/rbug/rbug_core.c
index 5752e5e..d09c4b5 100644
--- a/src/gallium/drivers/rbug/rbug_core.c
+++ b/src/gallium/drivers/rbug/rbug_core.c
@@ -869,7 +869,7 @@ rbug_stop(struct rbug_rbug *tr_rbug)
       return;
 
    tr_rbug->running = false;
-   pipe_thread_wait(tr_rbug->thread);
+   thrd_join(tr_rbug->thread, NULL);
 
    FREE(tr_rbug);
 
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c
index 5ec3d34..47a715d 100644
--- a/src/gallium/state_trackers/nine/nine_state.c
+++ b/src/gallium/state_trackers/nine/nine_state.c
@@ -238,7 +238,7 @@ nine_csmt_destroy( struct NineDevice9 *device, struct csmt_context *ctx )
 
     FREE(ctx);
 
-    pipe_thread_wait(render_thread);
+    thrd_join(render_thread, NULL);
 }
 
 static void
diff --git a/src/gallium/tests/unit/pipe_barrier_test.c b/src/gallium/tests/unit/pipe_barrier_test.c
index 34a77b8..f77f1e1 100644
--- a/src/gallium/tests/unit/pipe_barrier_test.c
+++ b/src/gallium/tests/unit/pipe_barrier_test.c
@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
    }
 
    for (i = 0; i < NUM_THREADS; i++ ) {
-      pipe_thread_wait(threads[i]);
+      thrd_join(threads[i], NULL);
    }
 
    CHECK(p_atomic_read(&proceeded) == NUM_THREADS);




More information about the mesa-commit mailing list