feat(thread): add SGetCurrentThreadId

This commit is contained in:
fallenoak 2021-12-17 15:43:58 -06:00
parent 34e01acca5
commit 8a90f867ae
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
3 changed files with 30 additions and 0 deletions

19
storm/Thread.cpp Normal file
View file

@ -0,0 +1,19 @@
#include "storm/Thread.hpp"
#if defined(WHOA_SYSTEM_WIN)
#include <windows.h>
#endif
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
#include <pthread.h>
#endif
uintptr_t SGetCurrentThreadId() {
#if defined(WHOA_SYSTEM_WIN)
return GetCurrentThreadId();
#endif
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
return reinterpret_cast<uintptr_t>(pthread_self());
#endif
}