Commit 75162adf authored by Bartosz Podrygajlo's avatar Bartosz Podrygajlo

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.
parent f9bff3d6
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment