Skip to content

Commit

Permalink
[atomic_shared_ptr_storage] fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
iboB committed Dec 14, 2022
1 parent fd8586a commit b0dba6c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/t-atomic_shared_ptr_storage.inl
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,9 @@ TEST_CASE("[itlib::atomic_shared_ptr_storage] exchange") {
ta.join();
tb.join();

CHECK(sum.load() >= 2);
// if thread b completed all of its iterations before a managed to do one,
// we will end up with 100% fail rate in b and a stored in storage
sum += storage.compare_exchange(a, b);

CHECK(sum >= 2);
}

0 comments on commit b0dba6c

Please sign in to comment.