summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Src/Thread.cpp')
-rw-r--r--Source/Core/Common/Src/Thread.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp
index 8346ccb592..13ee37cd89 100644
--- a/Source/Core/Common/Src/Thread.cpp
+++ b/Source/Core/Common/Src/Thread.cpp
@@ -117,7 +117,12 @@ void Thread::SetCurrentThreadAffinity(int mask)
SetThreadAffinityMask(GetCurrentThread(), mask);
}
-#ifdef _WIN32
+bool Thread::IsCurrentThread()
+{
+ return GetCurrentThreadId() == m_threadId;
+}
+
+
EventEx::EventEx()
{
InterlockedExchange(&m_Lock, 1);
@@ -169,7 +174,7 @@ bool EventEx::MsgWait()
}
return true;
}
-#endif
+
// Regular same thread loop based waiting
Event::Event()
@@ -397,6 +402,11 @@ void Thread::SetCurrentThreadAffinity(int mask)
#endif
}
+bool Thread::IsCurrentThread()
+{
+ return pthread_equal(pthread_self(), thread_id) != 0;
+}
+
void InitThreading() {
static int thread_init_done = 0;
if (thread_init_done)