Skip to content

Commit 08eedaa

Browse files
committedMar 13, 2025
Throw if BFS benchmark push fails
1 parent 180d636 commit 08eedaa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎relaxed_concurrent_fifo/benchmark.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,9 @@ struct benchmark_bfs : benchmark_timed<> {
330330
auto old_d = distances[target].value.load(std::memory_order_relaxed);
331331
while (d < old_d) {
332332
if (distances[target].value.compare_exchange_weak(old_d, d, std::memory_order_relaxed)) {
333-
handle.push((static_cast<std::uint64_t>(d) << 32) | target);
333+
if (!handle.push((static_cast<std::uint64_t>(d) << 32) | target)) {
334+
throw std::runtime_error("Push failed!");
335+
}
334336
++counter.pushed_nodes;
335337
break;
336338
}

0 commit comments

Comments
 (0)