mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 08:54:15 +00:00
Beta match MxAutoLock and MxCriticalSection (#1638)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
@@ -3,15 +3,27 @@
|
||||
|
||||
class MxCriticalSection;
|
||||
|
||||
#ifdef BETA10
|
||||
#define AUTOLOCK(CS) MxAutoLock lock(&CS, __FILE__, __LINE__)
|
||||
#else
|
||||
#define AUTOLOCK(CS) MxAutoLock lock(&CS)
|
||||
#endif
|
||||
|
||||
class MxAutoLock {
|
||||
public:
|
||||
#ifdef BETA10
|
||||
MxAutoLock(MxCriticalSection* p_criticalSection, const char* filename, int line);
|
||||
#else
|
||||
MxAutoLock(MxCriticalSection* p_criticalSection);
|
||||
#endif
|
||||
~MxAutoLock();
|
||||
|
||||
private:
|
||||
MxCriticalSection* m_criticalSection; // 0x00
|
||||
|
||||
#ifdef BETA10
|
||||
unsigned long m_currentThreadId; // 0x04
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // MXAUTOLOCK_H
|
||||
|
||||
@@ -11,7 +11,11 @@ public:
|
||||
|
||||
static void SetDoMutex();
|
||||
|
||||
#ifdef BETA10
|
||||
void Enter(unsigned long p_threadId, const char* filename, int line);
|
||||
#else
|
||||
void Enter();
|
||||
#endif
|
||||
void Leave();
|
||||
|
||||
private:
|
||||
@@ -19,4 +23,11 @@ private:
|
||||
HANDLE m_mutex; // 0x18
|
||||
};
|
||||
|
||||
#ifdef BETA10
|
||||
// TODO: Not quite correct yet, the second argument becomes a relocated value
|
||||
#define ENTER(criticalSection) criticalSection.Enter(-1, NULL, 0)
|
||||
#else
|
||||
#define ENTER(criticalSection) criticalSection.Enter()
|
||||
#endif
|
||||
|
||||
#endif // MXCRITICALSECTION_H
|
||||
|
||||
Reference in New Issue
Block a user