Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCoding/Private/External/LC_CriticalSection.h
Chris Gagnon 56e73ed431 Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor)
#rb none

[CL 6042607 by Chris Gagnon in Dev-Editor branch]
2019-04-22 18:56:08 -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;
};