Skip to content

Commit

Permalink
reloc test wrong atomic usage
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa authored and hkaiser committed Oct 16, 2023
1 parent 0e09575 commit 8e1f27f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ struct non_trivially_relocatable_struct_throwing
non_trivially_relocatable_struct_throwing&& other)
: data(other.data)
{
if (move_count.load() == K)
if (move_count.fetch_add(1) == K)
{
throw 42;
}
move_count.fetch_add(1);

count++;
}
Expand Down

0 comments on commit 8e1f27f

Please sign in to comment.