Fix various issues found with thread sanitizer on macOS
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user