[Mesa-dev] [PATCH] util/u_thread: fix compilation on Mac OS

Marek Olšák maraeo at gmail.com
Fri Nov 10 12:47:14 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Fri, Nov 10, 2017 at 12:38 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Apparently, it doesn't have pthread barriers.
>
> p_config.h (which was originally used to guard this code) uses the
> __APPLE__ macro to detect Mac OS.
>
> Fixes: f0d3a4de75 ("util: move pipe_barrier into src/util and rename to util_barrier")
> Cc: Roland Scheidegger <sroland at vmware.com>
> ---
>  src/util/u_thread.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/util/u_thread.h b/src/util/u_thread.h
> index e484d8aa74f..26cc0b0934b 100644
> --- a/src/util/u_thread.h
> +++ b/src/util/u_thread.h
> @@ -97,21 +97,21 @@ static inline bool u_thread_is_self(thrd_t thread)
>     return pthread_equal(pthread_self(), thread);
>  #  endif
>  #endif
>     return false;
>  }
>
>  /*
>   * util_barrier
>   */
>
> -#if defined(HAVE_PTHREAD)
> +#if defined(HAVE_PTHREAD) && !defined(__APPLE__)
>
>  typedef pthread_barrier_t util_barrier;
>
>  static inline void util_barrier_init(util_barrier *barrier, unsigned count)
>  {
>     pthread_barrier_init(barrier, NULL, count);
>  }
>
>  static inline void util_barrier_destroy(util_barrier *barrier)
>  {
> --
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list