Fix various issues found with thread sanitizer on macOS

This commit is contained in:
Wojtek Figat
2024-04-13 13:20:17 +02:00
parent 8144db8e13
commit 9c2c02c1cf
10 changed files with 70 additions and 75 deletions

View File

@@ -115,7 +115,7 @@ public:
// Rollback state and cancel
_context = nullptr;
_state = TaskState::Queued;
SetState(TaskState::Queued);
Cancel();
}
@@ -148,8 +148,7 @@ protected:
ASSERT(_context != nullptr);
_context->OnCancelSync(this);
_context = nullptr;
_state = TaskState::Canceled;
SetState(TaskState::Canceled);
}
else
{

View File

@@ -9,9 +9,8 @@
void GPUTask::Execute(GPUTasksContext* context)
{
// Begin
ASSERT(IsQueued() && _context == nullptr);
_state = TaskState::Running;
SetState(TaskState::Running);
// Perform an operation
const auto result = run(context);
@@ -19,7 +18,7 @@ void GPUTask::Execute(GPUTasksContext* context)
// Process result
if (IsCancelRequested())
{
_state = TaskState::Canceled;
SetState(TaskState::Canceled);
}
else if (result != Result::Ok)
{