Skip to content

Commit

Permalink
Add comments on thread safety.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-zint committed Oct 10, 2023
1 parent 7cf5e6c commit 3d2115f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/wmtk/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ void Scheduler::run_operation_on_all(PrimitiveType type, const std::string& name
// run();
for (operations::OperationQueue& q : m_per_thread_queues) {
q.run();
m_num_op_success += q.number_of_successful_operations();
m_num_op_fail += q.number_of_failed_operations();
m_num_op_success += q.number_of_successful_operations(); // needs to be done thread safe
m_num_op_fail += q.number_of_failed_operations(); // needs to be done thread safe
}
// enqueue_operations(ops);
// TODO: pick some strategy for running these operations
Expand Down
4 changes: 2 additions & 2 deletions src/wmtk/operations/OperationQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class OperationQueue
{
auto op = pop_top();
if ((*op)()) {
++m_num_op_success;
++m_num_op_success; // needs to be done thread safe
spdlog::debug("Op succeeded");
} else {
++m_num_op_fail;
++m_num_op_fail; // needs to be done thread safe
spdlog::debug("Op failed");
}
}
Expand Down

0 comments on commit 3d2115f

Please sign in to comment.