Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCoding/Private/External/LC_CriticalSection.h
Ben Marsh 5651dbf4cd Integrating changes from Live++ 1.4.1.
#rb none

[CL 5919984 by Ben Marsh in Dev-Build branch]
2019-04-16 12:46:58 -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;
};