From 945db73ec6ce7f850566ff59048204cdac91d6c6 Mon Sep 17 00:00:00 2001 From: Jorge Acereda Date: Sun, 25 Feb 2024 12:43:00 +0100 Subject: [PATCH] Haiku OS thread info --- public/common/TracySystem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/common/TracySystem.cpp b/public/common/TracySystem.cpp index 303b3cf3..77b66d44 100644 --- a/public/common/TracySystem.cpp +++ b/public/common/TracySystem.cpp @@ -200,6 +200,8 @@ TRACY_API void SetThreadName( const char* name ) pthread_setname_np( pthread_self(), buf ); } }; +#elif defined __HAIKU__ + rename_thread(find_thread(0), name); #endif #ifdef TRACY_ENABLE { @@ -284,6 +286,10 @@ TRACY_API const char* GetThreadName( uint32_t id ) if (pthread_getname_np(static_cast(id), qnxNameBuf, _NTO_THREAD_NAME_MAX) == 0) { return qnxNameBuf; }; +#elif defined __HAIKU__ + thread_info ti; + get_thread_info(find_thread(NULL), &ti); + snprintf(buf, sizeof(buf), "%s", ti.name); #endif sprintf( buf, "%" PRIu32, id );