From 766818baa8eedc946f2df71428260121179f63c6 Mon Sep 17 00:00:00 2001 From: nitsuja- Date: Sat, 17 Apr 2010 21:02:03 +0000 Subject: possible savestate memory leak fix in DoBuffer made Lua run on the CPU thread to fix unreliable script execution issues several fixes so the Lua savestate functions can actually work added Lua function savestate.verify to help with catching desyncs implemented FailVerifyAtFrameBoundary in Lua interface added a Clear button to the LuaWindow git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5382 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Thread.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/Src/Thread.cpp') 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) -- cgit v1.2.3