Files
UnrealEngineUWP/Engine/Source/Developer/UnrealCodeAnalyzerTests/Private/ThreadSafety.cpp
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

63 lines
1.1 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#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);
}