template <class LockClass> class CryOptionalAutoLock;
CryThread.h
CryOptionalAutoLock implements a helper class to automatically lock critical section (if needed) in constructor and release on destructor.
void Acquire();
CryOptionalAutoLock(LockClass & Lock, bool acquireLock);
void Release();