Skip to content

Commit 8be1dcb

Browse files
authored
Remove unused tracker_mutex (#567)
This resolves #566.
1 parent 4523047 commit 8be1dcb

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

include/CXXGraph/Graph/Algorithm/BestFirstSearch_impl.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ const std::vector<Node<T>> Graph<T>::concurrency_breadth_first_search(
147147
// a worker is assigned a small part of tasks for each time
148148
// assignments of tasks in current level and updates of tasks in next
149149
// level are inclusive
150-
std::mutex tracker_mutex;
151150
std::mutex next_tracker_mutex;
152151
std::atomic<int> assigned_tasks = 0;
153152
int num_tasks = 1;
@@ -158,13 +157,6 @@ const std::vector<Node<T>> Graph<T>::concurrency_breadth_first_search(
158157

159158
auto extract_tasks = [&assigned_tasks, &num_tasks,
160159
&block_size]() -> std::pair<int, int> {
161-
/*
162-
std::lock_guard<std::mutex> tracker_guard(tracker_mutex);
163-
int task_block_size = std::min(num_tasks - assigned_tasks,
164-
block_size); std::pair<int,int> task_block{assigned_tasks,
165-
assigned_tasks + task_block_size}; assigned_tasks += task_block_size;
166-
return task_block;
167-
*/
168160
int start = assigned_tasks.fetch_add(block_size);
169161
int end = std::min(num_tasks, start + block_size);
170162
return {start, end};

0 commit comments

Comments
 (0)