From d82d8be6148b599ce47bf4c0e6ae4e27cf5cc233 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 6 Mar 2017 11:58:27 +1100 Subject: [PATCH] gallium/util: replace pipe_thread_wait() with thrd_join() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Replace done using: find ./src -type f -exec sed -i -- \ 's:pipe_thread_wait(\([^)]*\)):thrd_join(\1, NULL):g' {} \; Reviewed-by: Plamena Manolova Reviewed-by: Marek Olšák --- 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 bb767fa12d2..2aad3e2d728 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 a3aed29795b..9565c538260 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 a52975d8cb2..eae128a2a0f 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 2f222d00589..678ef0bd0bf 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 df43a6e8752..1b51af4cdc0 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 5752e5e739c..d09c4b51960 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 5ec3d348487..47a715d5cc9 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 34a77b8196f..f77f1e1a8ef 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); -- 2.30.2