Files
UnrealEngineUWP/Engine/Source/Developer/UnrealCodeAnalyzerTests/Private/ThreadSafety.cpp
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

64 lines
1.2 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "UnrealCodeAnalyzerTestsPCH.h"
#include "ThreadSafety.h"
int32 GGlobalValue;
#define MY_DEFINE(x) GGlobalValue = x;
void GGlobalFunc()
{}
class FClassWithStaticFunction
{
public:
static void StaticFunction()
{ }
};
class FStructWithStaticFunction
{
public:
static void StaticFunction()
{ }
};
void FunctionUsingInt(int32 Param)
{
}
void UObjectDerivedThreadSafetyTest::PostInitProperties()
{
Super::PostInitProperties();
MY_DEFINE(3);
GGlobalValue = 5;
GGlobalFunc();
FClassWithStaticFunction::StaticFunction();
FStructWithStaticFunction::StaticFunction();
FunctionUsingInt(GGlobalValue);
}
void UObjectDerivedThreadSafetyTest::Serialize(FArchive& Ar)
{
Super::Serialize(Ar);
MY_DEFINE(3);
GGlobalValue = 5;
GGlobalFunc();
FClassWithStaticFunction::StaticFunction();
FStructWithStaticFunction::StaticFunction();
FunctionUsingInt(GGlobalValue);
}
UObjectDerivedThreadSafetyTest::UObjectDerivedThreadSafetyTest()
{
MY_DEFINE(4);
GGlobalFunc();
GGlobalValue = 5;
FClassWithStaticFunction::StaticFunction();
FStructWithStaticFunction::StaticFunction();
FunctionUsingInt(GGlobalValue);
}