aboutsummaryrefslogtreecommitdiff
path: root/zencore/thread.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-10-25 10:27:49 +0200
committerMartin Ridgers <[email protected]>2021-10-25 22:50:43 +0200
commit783c8255be9dc79f3bc05026300d20195f879e0d (patch)
treec6a9ee223c551446c5ddf27f464513de87e85f91 /zencore/thread.cpp
parentpthread implementation for naming a thread (diff)
downloadzen-783c8255be9dc79f3bc05026300d20195f879e0d.tar.xz
zen-783c8255be9dc79f3bc05026300d20195f879e0d.zip
Added a zen::GetCurrentThreadId()
Diffstat (limited to 'zencore/thread.cpp')
-rw-r--r--zencore/thread.cpp10
1 files changed, 10 insertions, 0 deletions
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)
{