From 8e1f27f1ce341373b307f1a87e1c2ed17d9810a1 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Sun, 15 Oct 2023 01:12:19 +0300 Subject: [PATCH] reloc test wrong atomic usage --- .../tests/unit/algorithms/uninitialized_relocate_par.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_par.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_par.cpp index e5fcd1d28ece..509ebeaf5d85 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_par.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_par.cpp @@ -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++; }