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;