diff options
| -rw-r--r-- | zencore/include/zencore/thread.h | 1 | ||||
| -rw-r--r-- | zencore/thread.cpp | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/zencore/include/zencore/thread.h b/zencore/include/zencore/thread.h index 48a58a261..3feb12936 100644 --- a/zencore/include/zencore/thread.h +++ b/zencore/include/zencore/thread.h @@ -174,6 +174,7 @@ private: ZENCORE_API bool IsProcessRunning(int pid); ZENCORE_API int GetCurrentProcessId(); +ZENCORE_API int GetCurrentThreadId(); ZENCORE_API void Sleep(int ms); diff --git a/zencore/thread.cpp b/zencore/thread.cpp index c20d10db3..2abdde067 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -438,6 +438,16 @@ GetCurrentProcessId() #endif } +int +GetCurrentThreadId() +{ +#if ZEN_PLATFORM_WINDOWS + return ::GetCurrentThreadId(); +#else + return int(gettid()); +#endif +} + void Sleep(int ms) { |