gallium/util: replace pipe_thread_wait() with thrd_join()
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 6 Mar 2017 00:58:27 +0000 (11:58 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 6 Mar 2017 22:12:16 +0000 (09:12 +1100)
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@intel.com>
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/drivers/ddebug/dd_context.c
src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/radeon/r600_gpu_load.c
src/gallium/drivers/rbug/rbug_core.c
src/gallium/state_trackers/nine/nine_state.c
src/gallium/tests/unit/pipe_barrier_test.c

index bb767fa12d23e42fb63467b062a42ae1196c2f0c..2aad3e2d728f7e943584b467c7a814b300e4fb62 100644 (file)
@@ -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 );
index a3aed29795bb96244ddcfae481011cc7840bd66e..9565c5382608f13c2ee3ce15a1edb42d9ec2a12d 100644 (file)
@@ -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;
 }
 
index a52975d8cb2bb5da819dd7dff233c08c78ab10d9..eae128a2a0fe8d43b7933b060c09d03ec20d108a 100644 (file)
@@ -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);
    }
index 2f222d0058961c27a5361fc198fed597dc345dc4..678ef0bd0bf5532efaa5c0288eae00b1fd4ead33 100644 (file)
@@ -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
    }
 
index df43a6e875215669001db9737b022efce9d869bb..1b51af4cdc011b96e18db0b2bcc3a37ae6fdd9a6 100644 (file)
@@ -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;
 }
 
index 5752e5e739cc71dfae6d26d0c656bbf9cb95fb4f..d09c4b51960477f4e3a716f2f9cf822ddf379506 100644 (file)
@@ -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);
 
index 5ec3d3484877b5679ce49ad504b97719b5dc62d8..47a715d5cc9e15e31a3d64512e73da871ad04f93 100644 (file)
@@ -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
index 34a77b8196f73047b4f0fad51539fe1a1da83589..f77f1e1a8eff9aa7e44dd88ad41a849fcf459f7e 100644 (file)
@@ -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);