aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/interrupt_signals_ut.cpp
diff options
context:
space:
mode:
authoreeight <eeight@yandex-team.ru>2022-05-19 23:51:39 +0300
committereeight <eeight@yandex-team.ru>2022-05-19 23:51:39 +0300
commitd98cd6128e8838e19ae1a95be34385af299dd62a (patch)
tree2c3a778d7d8edf24ee8855beda0def8742bc6722 /util/system/interrupt_signals_ut.cpp
parentb6eecf2aaed456793a9f0e559af11e63bace7e60 (diff)
downloadydb-d98cd6128e8838e19ae1a95be34385af299dd62a.tar.gz
IGNIETFERRO-1105 Get rid of TAtomic in unittests
ref:f4d9cf527b4f26efcc95307ca7b07d1c42ebd11b
Diffstat (limited to 'util/system/interrupt_signals_ut.cpp')
-rw-r--r--util/system/interrupt_signals_ut.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/util/system/interrupt_signals_ut.cpp b/util/system/interrupt_signals_ut.cpp
index bec54fec61..2a7f0bddd7 100644
--- a/util/system/interrupt_signals_ut.cpp
+++ b/util/system/interrupt_signals_ut.cpp
@@ -1,20 +1,20 @@
#include "interrupt_signals.h"
-#include "atomic.h"
-
#include <util/datetime/base.h>
#include <library/cpp/testing/unittest/registar.h>
+#include <atomic>
+
#ifdef _win_
#include <windows.h>
#endif
Y_UNIT_TEST_SUITE(TTestInterruptSignals) {
- static TAtomic HandledSigNum = 0;
+ static std::atomic<size_t> HandledSigNum = 0;
static void Handler(int signum) {
- AtomicSet(HandledSigNum, signum);
+ HandledSigNum.store(signum);
}
Y_UNIT_TEST(Test1) {
@@ -31,7 +31,7 @@ Y_UNIT_TEST_SUITE(TTestInterruptSignals) {
UNIT_FAIL("GenerateConsoleCtrlEvent failed: " << LastSystemErrorText());
}
Sleep(TDuration::MilliSeconds(100));
- UNIT_ASSERT_VALUES_EQUAL(HandledSigNum, posixSigNum);
+ UNIT_ASSERT_VALUES_EQUAL(HandledSigNum.load(), posixSigNum);
}
*/
for (int signum : {SIGINT, SIGTERM}) {
@@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(TTestInterruptSignals) {
#endif
std::raise(signum);
Sleep(TDuration::MilliSeconds(100)); // give it time to handle an async signal
- UNIT_ASSERT_VALUES_EQUAL(HandledSigNum, signum);
+ UNIT_ASSERT_VALUES_EQUAL(HandledSigNum.load(), signum);
}
}
}