summaryrefslogtreecommitdiffstats
path: root/util/thread/pool_ut.cpp
diff options
context:
space:
mode:
authorspacelord <[email protected]>2022-02-10 16:48:15 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:48:15 +0300
commita0c6d9ad0cf6b94c527a15da147eb24335281b6d (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/thread/pool_ut.cpp
parent16747e4f77455cca4932df21eb76f12cb0a97a5c (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/thread/pool_ut.cpp')
-rw-r--r--util/thread/pool_ut.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/util/thread/pool_ut.cpp b/util/thread/pool_ut.cpp
index 07b0e0a235f..893770d0c47 100644
--- a/util/thread/pool_ut.cpp
+++ b/util/thread/pool_ut.cpp
@@ -32,24 +32,24 @@ struct TThreadPoolTest {
};
struct TOwnedTask: public IObjectInQueue {
- bool& Processed;
- bool& Destructed;
-
- TOwnedTask(bool& processed, bool& destructed)
- : Processed(processed)
- , Destructed(destructed)
- {
- }
-
+ bool& Processed;
+ bool& Destructed;
+
+ TOwnedTask(bool& processed, bool& destructed)
+ : Processed(processed)
+ , Destructed(destructed)
+ {
+ }
+
~TOwnedTask() override {
- Destructed = true;
- }
-
- void Process(void*) override {
- Processed = true;
- }
- };
-
+ Destructed = true;
+ }
+
+ void Process(void*) override {
+ Processed = true;
+ }
+ };
+
inline void TestAnyQueue(IThreadPool* queue, size_t queueSize = 1000) {
TReallyFastRng32 rand(17);
const size_t cnt = 1000;
@@ -112,18 +112,18 @@ Y_UNIT_TEST_SUITE(TThreadPoolTest) {
t.TestAnyQueue(&q);
}
}
-
+
Y_UNIT_TEST(TestAddAndOwn) {
TThreadPool q;
- q.Start(2);
- bool processed = false;
- bool destructed = false;
+ q.Start(2);
+ bool processed = false;
+ bool destructed = false;
q.SafeAddAndOwn(MakeHolder<TThreadPoolTest::TOwnedTask>(processed, destructed));
- q.Stop();
-
- UNIT_ASSERT_C(processed, "Not processed");
- UNIT_ASSERT_C(destructed, "Not destructed");
- }
+ q.Stop();
+
+ UNIT_ASSERT_C(processed, "Not processed");
+ UNIT_ASSERT_C(destructed, "Not destructed");
+ }
Y_UNIT_TEST(TestAddFunc) {
TFailAddQueue queue;