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
This commit is contained in:
hrydgard
2008-09-24 20:47:11 +00:00
parent 3883ce6ee9
commit 08e81eddb9
6 changed files with 116 additions and 165 deletions

View File

@ -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
};