Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCoding/Private/External/LC_CriticalSection.h
ben marsh b78d96355f LiveCoding: Merging fixes to resolve issues with global symbols being reconstructed when loading patch DLLs. Was causing asserts when log channels were re-registered etc...
#jira
#rb none

#ROBOMERGE-OWNER: ryan.vance
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 5993252 via CL 5993257 via CL 5995286 via CL 5995562
#ROBOMERGE-BOT: DEVVR (Main -> Dev-VR)

[CL 6004844 by ben marsh in Dev-VR branch]
2019-04-18 21:57:56 -04:00

44 lines
678 B
C++

// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
#pragma once
#include "CoreTypes.h"
#include "Windows/MinimalWindowsApi.h"
#include "LC_Platform.h"
class CriticalSection
{
public:
CriticalSection(void);
~CriticalSection(void);
void Enter(void);
void Leave(void);
class ScopedLock
{
public:
explicit ScopedLock(CriticalSection* cs)
: m_cs(cs)
{
cs->Enter();
}
~ScopedLock(void)
{
m_cs->Leave();
}
private:
LC_DISABLE_COPY(ScopedLock);
LC_DISABLE_MOVE(ScopedLock);
LC_DISABLE_ASSIGNMENT(ScopedLock);
LC_DISABLE_MOVE_ASSIGNMENT(ScopedLock);
CriticalSection* m_cs;
};
private:
Windows::CRITICAL_SECTION m_cs;
};