X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Futil%2Fu_thread.h;h=af44bcfc1bd6c0ab97b9ca27e146e49a8c4966f8;hb=HEAD;hp=6fc89099fec9d1efdb8594d5d73b7aac5d55f367;hpb=9661fc9cdb42bc8d329feb30f3e80f511e60920e;p=mesa.git diff --git a/src/util/u_thread.h b/src/util/u_thread.h index 6fc89099fec..af44bcfc1bd 100644 --- a/src/util/u_thread.h +++ b/src/util/u_thread.h @@ -35,12 +35,20 @@ #ifdef HAVE_PTHREAD #include -#ifdef PTHREAD_SETAFFINITY_IN_NP_HEADER +#ifdef HAVE_PTHREAD_NP_H #include #endif #endif +#ifdef __HAIKU__ +#include +#endif + #ifdef __FreeBSD__ +/* pthread_np.h -> sys/param.h -> machine/param.h + * - defines ALIGN which clashes with our ALIGN + */ +#undef ALIGN #define cpu_set_t cpuset_t #endif @@ -77,8 +85,10 @@ static inline void u_thread_setname( const char *name ) pthread_setname_np(pthread_self(), "%s", (void *)name); #elif DETECT_OS_APPLE pthread_setname_np(name); +#elif DETECT_OS_HAIKU + rename_thread(find_thread(NULL), name); #else -#error Not sure how to call pthread_setname_np +#warning Not sure how to call pthread_setname_np #endif #endif (void)name; @@ -149,7 +159,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(HAVE_PTHREAD) && !defined(__APPLE__) +#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__) struct timespec ts; clockid_t cid;