Optimize C++ compilation time
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Engine/Core/Memory/Memory.h"
|
||||
#define MOODYCAMEL_EXCEPTIONS_ENABLED 0
|
||||
#include <ThirdParty/concurrentqueue.h>
|
||||
|
||||
/// <summary>
|
||||
@@ -42,7 +43,6 @@ public:
|
||||
/// <summary>
|
||||
/// Gets an estimate of the total number of elements currently in the queue.
|
||||
/// </summary>
|
||||
/// <returns>The items count.</returns>
|
||||
FORCE_INLINE int32 Count() const
|
||||
{
|
||||
return static_cast<int32>(Base::size_approx());
|
||||
|
||||
@@ -7,11 +7,17 @@
|
||||
#include "ConcurrentTaskQueue.h"
|
||||
#include "Engine/Core/Log.h"
|
||||
#include "Engine/Core/Math/Math.h"
|
||||
#include "Engine/Engine/Globals.h"
|
||||
#include "Engine/Engine/EngineService.h"
|
||||
#include "Engine/Platform/ConditionVariable.h"
|
||||
#include "Engine/Platform/CPUInfo.h"
|
||||
#include "Engine/Platform/Thread.h"
|
||||
|
||||
FLAXENGINE_API bool IsInMainThread()
|
||||
{
|
||||
return Globals::MainThreadID == Platform::GetCurrentThreadID();
|
||||
}
|
||||
|
||||
namespace ThreadPoolImpl
|
||||
{
|
||||
volatile int64 ExitFlag = 0;
|
||||
|
||||
@@ -2,18 +2,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Engine/Platform/Platform.h"
|
||||
#include "Engine/Platform/CriticalSection.h"
|
||||
#include "Engine/Engine/Globals.h"
|
||||
|
||||
/// <summary>
|
||||
/// Checks if current execution in on the main thread.
|
||||
/// </summary>
|
||||
/// <returns>True if running on the main thread, otherwise false.</returns>
|
||||
inline bool IsInMainThread()
|
||||
{
|
||||
return Globals::MainThreadID == Platform::GetCurrentThreadID();
|
||||
}
|
||||
FLAXENGINE_API bool IsInMainThread();
|
||||
|
||||
/// <summary>
|
||||
/// Scope locker for critical section.
|
||||
@@ -31,20 +25,9 @@ private:
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Init, enters critical section
|
||||
/// Init, enters critical section.
|
||||
/// </summary>
|
||||
/// <param name="section">The synchronization object to manage</param>
|
||||
ScopeLock(const CriticalSection* section)
|
||||
: _section(section)
|
||||
{
|
||||
ASSERT_LOW_LAYER(_section);
|
||||
_section->Lock();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init, enters critical section
|
||||
/// </summary>
|
||||
/// <param name="section">The synchronization object to manage</param>
|
||||
/// <param name="section">The synchronization object to lock.</param>
|
||||
ScopeLock(const CriticalSection& section)
|
||||
: _section(§ion)
|
||||
{
|
||||
@@ -52,7 +35,7 @@ public:
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destructor, releases critical section
|
||||
/// Destructor, releases critical section.
|
||||
/// </summary>
|
||||
~ScopeLock()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user