Improve assert in completed_task_ans()

This assert checks if the structure is correctly initialized. The structure
is one-time use so the assert is valid, but the value of the atomic was added
to the output to improve debugging.
This commit is contained in:
Bartosz Podrygajlo
2025-01-03 08:11:35 +01:00
parent f9bff3d6a0
commit 75162adf68
+2 -2
View File
@@ -31,8 +31,8 @@ void completed_task_ans(task_ans_t* task)
{
DevAssert(task != NULL);
if (atomic_load_explicit(&task->status, memory_order_acquire) != 0)
AssertFatal(0, "Task already finished?");
int status = atomic_load_explicit(&task->status, memory_order_acquire);
AssertFatal(status == 0, "Task not expected to be finished here. Status = %d\n", status);
atomic_store_explicit(&task->status, 1, memory_order_release);
}