diff options
author | Timothy Arceri <[email protected]> | 2017-03-05 12:39:49 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-03-07 08:53:27 +1100 |
commit | e5375ba028c8ca48b11b86068efb65c4e03153eb (patch) | |
tree | ccf5ae97fa554484a2ae81945f3fb5ca64cdc6a8 /src/gallium/auxiliary | |
parent | 628e84a58fdb26c63a705861b92f65f242613321 (diff) |
gallium/util: replace pipe_thread with thrd_t
pipe_thread was made unnecessary with fd33a6bcd7f12.
V2: fix compile error in u_queue.c
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/os/os_thread.h | 16 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_queue.c | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_queue.h | 2 |
3 files changed, 8 insertions, 12 deletions
diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h index a429f4eaf76..ad2cda431d1 100644 --- a/src/gallium/auxiliary/os/os_thread.h +++ b/src/gallium/auxiliary/os/os_thread.h @@ -47,16 +47,12 @@ #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; diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c index 25252300897..b20abc8f45d 100644 --- a/src/gallium/auxiliary/util/u_queue.c +++ b/src/gallium/auxiliary/util/u_queue.c @@ -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; diff --git a/src/gallium/auxiliary/util/u_queue.h b/src/gallium/auxiliary/util/u_queue.h index 8d4804f5c6a..635545f3a65 100644 --- a/src/gallium/auxiliary/util/u_queue.h +++ b/src/gallium/auxiliary/util/u_queue.h @@ -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; |