aboutsummaryrefslogtreecommitdiffstats
path: root/util/thread
diff options
context:
space:
mode:
authorfippo <fippo@yandex-team.ru>2022-02-10 16:50:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:08 +0300
commit3e57c324d47a3a202cb3c5a9648d2f92103d5213 (patch)
tree6913479b0d0b22ec99bbba7c96f2f930d9095600 /util/thread
parentbebbbda5c5ff4ec70d301ac897eb8d6c8da7a9a4 (diff)
downloadydb-3e57c324d47a3a202cb3c5a9648d2f92103d5213.tar.gz
Restoring authorship annotation for <fippo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/thread')
-rw-r--r--util/thread/factory.cpp14
-rw-r--r--util/thread/factory.h2
-rw-r--r--util/thread/pool.cpp6
3 files changed, 11 insertions, 11 deletions
diff --git a/util/thread/factory.cpp b/util/thread/factory.cpp
index 48e898f32d..082fe1a339 100644
--- a/util/thread/factory.cpp
+++ b/util/thread/factory.cpp
@@ -49,7 +49,7 @@ namespace {
return new TPoolThread;
}
};
-
+
class TThreadFactoryFuncObj: public IThreadFactory::IThreadAble {
public:
TThreadFactoryFuncObj(const std::function<void()>& func)
@@ -63,17 +63,17 @@ namespace {
private:
std::function<void()> Func;
- };
+ };
}
THolder<IThread> IThreadFactory::Run(std::function<void()> func) {
THolder<IThread> ret(DoCreate());
-
+
ret->Run(new ::TThreadFactoryFuncObj(func));
-
- return ret;
-}
-
+
+ return ret;
+}
+
static IThreadFactory* SystemThreadPoolImpl() {
return Singleton<TSystemThreadFactory>();
}
diff --git a/util/thread/factory.h b/util/thread/factory.h
index 561fcbac88..29b1aac16b 100644
--- a/util/thread/factory.h
+++ b/util/thread/factory.h
@@ -49,7 +49,7 @@ public:
// XXX: rename to Start
inline THolder<IThread> Run(IThreadAble* func) {
THolder<IThread> ret(DoCreate());
-
+
ret->Run(func);
return ret;
diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp
index 05fad02e9b..b6cb59644d 100644
--- a/util/thread/pool.cpp
+++ b/util/thread/pool.cpp
@@ -641,7 +641,7 @@ size_t TSimpleThreadPool::Size() const noexcept {
return 0;
}
-namespace {
+namespace {
class TOwnedObjectInQueue: public IObjectInQueue {
private:
THolder<IObjectInQueue> Owned;
@@ -657,8 +657,8 @@ namespace {
Owned->Process(data);
}
};
-}
-
+}
+
void IThreadPool::SafeAdd(IObjectInQueue* obj) {
Y_ENSURE_EX(Add(obj), TThreadPoolException() << TStringBuf("can not add object to queue"));
}