From c5d9a94ed9c48122eb5e51c2e84a40c3dc58710c Mon Sep 17 00:00:00 2001 From: Markus Diem Date: Fri, 3 Dec 2021 10:26:10 +0100 Subject: [PATCH] thread ID for EMSCRIPTEN --- easy_profiler_core/current_thread.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/easy_profiler_core/current_thread.h b/easy_profiler_core/current_thread.h index fc39ea3..ec24e9d 100644 --- a/easy_profiler_core/current_thread.h +++ b/easy_profiler_core/current_thread.h @@ -77,6 +77,9 @@ inline profiler::thread_id_t getCurrentThreadId() #elif defined(__QNX__) EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)gettid(); return _id; +#elif defined(__EMSCRIPTEN__) + EASY_THREAD_LOCAL static const profiler::thread_id_t _id = static_cast(pthread_self()); + return _id; #else EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)syscall(__NR_gettid); return _id;