summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-09-24 20:47:11 +0000
committerhrydgard <hrydgard@gmail.com>2008-09-24 20:47:11 +0000
commit08e81eddb97614a4e286a6f35092fe56c16a3113 (patch)
tree01d26d48f75e6de46c30f07ec444fff7cdbc3bd1 /Source/Core/Common
parent3883ce6ee9df56787d67493a02745dd760e27c6c (diff)
Protect dvdread with a critical section, should fix crashes when running ikaruga from a compressed iso. Some coding standard stuff.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@672 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/Thread.h33
1 files changed, 16 insertions, 17 deletions
diff --git a/Source/Core/Common/Src/Thread.h b/Source/Core/Common/Src/Thread.h
index 6043215eef..9e351bc839 100644
--- a/Source/Core/Common/Src/Thread.h
+++ b/Source/Core/Common/Src/Thread.h
@@ -49,13 +49,13 @@ class CriticalSection
#elif __GNUC__
pthread_mutex_t mutex;
#endif
- public:
+public:
- CriticalSection(int spincount = 1000);
- ~CriticalSection();
- void Enter();
- bool TryEnter();
- void Leave();
+ CriticalSection(int spincount = 1000);
+ ~CriticalSection();
+ void Enter();
+ bool TryEnter();
+ void Leave();
};
#ifdef _WIN32
@@ -66,23 +66,22 @@ typedef void* (*ThreadFunc)(void* arg);
class Thread
{
- public:
+public:
+ Thread(ThreadFunc entry, void* arg);
+ ~Thread();
- Thread(ThreadFunc entry, void* arg);
- ~Thread();
+ void WaitForDeath();
+ void SetAffinity(int mask);
+ static void SetCurrentThreadAffinity(int mask);
- void WaitForDeath();
- void SetAffinity(int mask);
- static void SetCurrentThreadAffinity(int mask);
-
- private:
+private:
#ifdef _WIN32
- HANDLE m_hThread;
- DWORD m_threadId;
+ HANDLE m_hThread;
+ DWORD m_threadId;
#elif __GNUC__
- pthread_t thread_id;
+ pthread_t thread_id;
#endif
};