- #pragma once
- //forward ref
- class Lock;
- class ILockable
- {
- friend Lock;
- public:
- ILockable();
- int InitCritSection();
- void FreeCriticalSection();
- private:
- CRITICAL_SECTION CriticalSection;
- int CriticalSectionInitialized;
- #ifdef _DEBUG
- // doubly linked list of active locks for debugging deadlocks
- Lock* pFirstLockDebugData;
- Lock* pLastLockDebugData;
- #endif
- int activeLockCount;
- };
- class Lock
- {
- public:
- #ifdef _DEBUG
- Lock(ILockable* it, char *_file, int _line);
- #else
- Lock(ILockable* it);
- #endif
- virtual ~Lock(void);
- private:
- ILockable* It;
- #ifdef _DEBUG
- char *file;
- int line;
- // doubly linked list
- Lock* pNextLockDebugData;
- Lock* pPrevLockDebugData;
- #endif
- };
- #ifdef _DEBUG
- #define LOCK(it) Lock __LOCK_IT__(it, __FILE__, __LINE__)
- #else
- #define LOCK(it) Lock __LOCK_IT__(it)
- #endif
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 14942 | Newtopian |
Branching //guest/perforce_software/p4api.net/... to //guest/Newtopian/p4api.net/... |
10 years ago | |
//guest/perforce_software/p4api.net/p4bridge/Lock.h | |||||
#2 | 8964 | Bill | fix line endings | 11 years ago | |
#1 | 8873 | Matt Attaway | Initial add of the P4API.NET source code | 11 years ago |