diff options
| author | nitsuja- <nitsuja-@hotmail.com> | 2010-04-17 21:02:03 +0000 |
|---|---|---|
| committer | nitsuja- <nitsuja-@hotmail.com> | 2010-04-17 21:02:03 +0000 |
| commit | 766818baa8eedc946f2df71428260121179f63c6 (patch) | |
| tree | b38d450ed8c4cb97fa4ea1eb3ce6c93b87c8f5dd /Source/Core/Common/Src/Thread.cpp | |
| parent | 3fb80c52af90f743ee1a304d37c1506a4b305c90 (diff) | |
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
Diffstat (limited to 'Source/Core/Common/Src/Thread.cpp')
| -rw-r--r-- | Source/Core/Common/Src/Thread.cpp | 14 |
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) |
