2015-07-24 05:54:24 -04:00
|
|
|
// Copyright 1998-2015 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()
|
|
|
|
|
{
|
2015-07-27 04:33:45 -04:00
|
|
|
Super::PostInitProperties();
|
|
|
|
|
|
2015-07-24 05:54:24 -04:00
|
|
|
MY_DEFINE(3);
|
|
|
|
|
GGlobalValue = 5;
|
|
|
|
|
GGlobalFunc();
|
|
|
|
|
FClassWithStaticFunction::StaticFunction();
|
|
|
|
|
FStructWithStaticFunction::StaticFunction();
|
|
|
|
|
FunctionUsingInt(GGlobalValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UObjectDerivedThreadSafetyTest::Serialize(FArchive& Ar)
|
|
|
|
|
{
|
2015-07-27 04:33:45 -04:00
|
|
|
Super::Serialize(Ar);
|
|
|
|
|
|
2015-07-24 05:54:24 -04:00
|
|
|
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);
|
|
|
|
|
}
|