Skip to content

Commit

Permalink
Fix std::memory_order according to changes in C++20
Browse files Browse the repository at this point in the history
The new code should be compatible with C++17 as well
  • Loading branch information
alxbilger committed Oct 22, 2024
1 parent 1d9f613 commit e58a66b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void ConstraintProblem::clear(int nbConstraints)
f.resize(nbConstraints);

static std::atomic<unsigned int> counter = 0;
problemId = counter.fetch_add(1, std::memory_order::memory_order_relaxed);
problemId = counter.fetch_add(1, std::memory_order_relaxed);
}

unsigned int ConstraintProblem::getProblemId()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ void DefaultTaskScheduler::WaitForWorkersToBeReady()

void DefaultTaskScheduler::setMainTaskStatus(const Task::Status* mainTaskStatus)
{
m_mainTaskStatus.store(mainTaskStatus, std::memory_order::memory_order_relaxed);
m_mainTaskStatus.store(mainTaskStatus, std::memory_order_relaxed);
}

bool DefaultTaskScheduler::testMainTaskStatus(const Task::Status* status)
{
return m_mainTaskStatus.load(std::memory_order::memory_order_relaxed) == status;
return m_mainTaskStatus.load(std::memory_order_relaxed) == status;
}

} // namespace sofa::simulation

0 comments on commit e58a66b

Please sign in to comment.