From 7e17b0e3c6c00d43cebac8eae7cdd4f05d9bb373 Mon Sep 17 00:00:00 2001 From: jesswong <5247012+jesswong@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:36:47 -0800 Subject: [PATCH] Add threadid macros for emscripten (#646) * Add threadid support for emscripten and bsd * address comments --- source/async_stack.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/async_stack.cpp b/source/async_stack.cpp index f63d9e8b..0970f238 100644 --- a/source/async_stack.cpp +++ b/source/async_stack.cpp @@ -99,8 +99,12 @@ static std::uint64_t get_os_thread_id() { return tid; # elif defined(_WIN32) return std::uint64_t(GetCurrentThreadId()); -# else +# elif defined(__EMSCRIPTEN__) + return 0; +# elif defined(__linux__) return std::uint64_t(gettid()); +# else +# error "Unsupported platform in get_os_thread_id" # endif } #endif // UNIFEX_ASYNC_STACK_ROOT_USE_PTHREAD == 0