[Mesa-dev] [PATCH] util/u_thread: don't restrict u_thread_get_time_nano() to __linux__

Marek Olšák maraeo at gmail.com
Mon Dec 2 22:12:16 UTC 2019


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

Marek

On Sat, Nov 30, 2019 at 10:17 AM Jonathan Gray <jsg at jsg.id.au> wrote:

> pthread_getcpuclockid() and clock_gettime() are also available on at least
> OpenBSD, FreeBSD, NetBSD, DragonFly, Cygwin.
>
> Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
> ---
>  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 6fc923c10e6..461d30bdd12 100644
> --- a/src/util/u_thread.h
> +++ b/src/util/u_thread.h
> @@ -149,7 +149,7 @@ util_get_L3_for_pinned_thread(thrd_t thread, unsigned
> cores_per_L3)
>  static inline int64_t
>  u_thread_get_time_nano(thrd_t thread)
>  {
> -#if defined(__linux__) && defined(HAVE_PTHREAD)
> +#if defined(HAVE_PTHREAD)
>     struct timespec ts;
>     clockid_t cid;
>
> --
> 2.24.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20191202/9e32be83/attachment.html>


More information about the mesa-dev mailing list