From e255778c07649bf6f235fc736680c62cf77f15b0 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 20 Feb 2024 12:59:00 +0100 Subject: [PATCH] Add profiler event to task wait method --- Source/Engine/Threading/Task.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Threading/Task.cpp b/Source/Engine/Threading/Task.cpp index 84737a71b..77af6ffb6 100644 --- a/Source/Engine/Threading/Task.cpp +++ b/Source/Engine/Threading/Task.cpp @@ -7,6 +7,7 @@ #include "Engine/Core/Types/DateTime.h" #include "Engine/Core/Collections/Array.h" #include "Engine/Core/Math/Math.h" +#include "Engine/Profiler/ProfilerCPU.h" void Task::Start() { @@ -37,6 +38,7 @@ void Task::Cancel() bool Task::Wait(double timeoutMilliseconds) const { + PROFILE_CPU(); double startTime = Platform::GetTimeSeconds() * 0.001; // TODO: no active waiting! use a semaphore! @@ -73,12 +75,9 @@ bool Task::Wait(double timeoutMilliseconds) const Task* Task::ContinueWith(Task* task) { ASSERT(task != nullptr && task != this); - if (_continueWith) return _continueWith->ContinueWith(task); - _continueWith = task; - return task; }