aboutsummaryrefslogtreecommitdiffstats
path: root/util/thread
diff options
context:
space:
mode:
authortender-bum <tender-bum@yandex-team.ru>2022-02-10 16:50:01 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:01 +0300
commit4aef354b224559d2b031487a10d4f5cc6e82e95a (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/thread
parentc78b06a63de7beec995c1007bc5332bdf3d75b69 (diff)
downloadydb-4aef354b224559d2b031487a10d4f5cc6e82e95a.tar.gz
Restoring authorship annotation for <tender-bum@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/thread')
-rw-r--r--util/thread/factory.cpp4
-rw-r--r--util/thread/factory.h6
-rw-r--r--util/thread/factory_ut.cpp4
-rw-r--r--util/thread/lfqueue.h2
-rw-r--r--util/thread/pool.cpp14
-rw-r--r--util/thread/pool.h6
-rw-r--r--util/thread/pool_ut.cpp2
7 files changed, 19 insertions, 19 deletions
diff --git a/util/thread/factory.cpp b/util/thread/factory.cpp
index 50a51680e24..48e898f32dc 100644
--- a/util/thread/factory.cpp
+++ b/util/thread/factory.cpp
@@ -66,8 +66,8 @@ namespace {
};
}
-THolder<IThread> IThreadFactory::Run(std::function<void()> func) {
- THolder<IThread> ret(DoCreate());
+THolder<IThread> IThreadFactory::Run(std::function<void()> func) {
+ THolder<IThread> ret(DoCreate());
ret->Run(new ::TThreadFactoryFuncObj(func));
diff --git a/util/thread/factory.h b/util/thread/factory.h
index 2330435d11d..561fcbac889 100644
--- a/util/thread/factory.h
+++ b/util/thread/factory.h
@@ -47,15 +47,15 @@ public:
virtual ~IThreadFactory() = default;
// XXX: rename to Start
- inline THolder<IThread> Run(IThreadAble* func) {
- THolder<IThread> ret(DoCreate());
+ inline THolder<IThread> Run(IThreadAble* func) {
+ THolder<IThread> ret(DoCreate());
ret->Run(func);
return ret;
}
- THolder<IThread> Run(std::function<void()> func);
+ THolder<IThread> Run(std::function<void()> func);
private:
virtual IThread* DoCreate() = 0;
diff --git a/util/thread/factory_ut.cpp b/util/thread/factory_ut.cpp
index 352c7c90a6f..647d96c9011 100644
--- a/util/thread/factory_ut.cpp
+++ b/util/thread/factory_ut.cpp
@@ -29,7 +29,7 @@ private:
TRunAble r;
{
- THolder<IThreadFactory::IThread> thr = SystemThreadFactory()->Run(&r);
+ THolder<IThreadFactory::IThread> thr = SystemThreadFactory()->Run(&r);
thr->Join();
}
@@ -45,7 +45,7 @@ private:
pool.Start(0);
- THolder<IThreadFactory::IThread> thr = pool.Run(&r);
+ THolder<IThreadFactory::IThread> thr = pool.Run(&r);
thr->Join();
}
diff --git a/util/thread/lfqueue.h b/util/thread/lfqueue.h
index 647c03fb3c9..ab523631e4f 100644
--- a/util/thread/lfqueue.h
+++ b/util/thread/lfqueue.h
@@ -362,7 +362,7 @@ public:
template <class T, class TCounter>
class TAutoLockFreeQueue {
public:
- using TRef = THolder<T>;
+ using TRef = THolder<T>;
inline ~TAutoLockFreeQueue() {
TRef tmp;
diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp
index 6f99c21e593..05fad02e9b9 100644
--- a/util/thread/pool.cpp
+++ b/util/thread/pool.cpp
@@ -68,7 +68,7 @@ TThreadFactoryHolder::TThreadFactoryHolder() noexcept
class TThreadPool::TImpl: public TIntrusiveListItem<TImpl>, public IThreadFactory::IThreadAble {
using TTsr = IThreadPool::TTsr;
using TJobQueue = TFastQueue<IObjectInQueue*>;
- using TThreadRef = THolder<IThreadFactory::IThread>;
+ using TThreadRef = THolder<IThreadFactory::IThread>;
public:
inline TImpl(TThreadPool* parent, size_t thrnum, size_t maxqueue, const TParams& params)
@@ -415,7 +415,7 @@ public:
private:
TImpl* Impl_;
- THolder<IThreadFactory::IThread> Thread_;
+ THolder<IThreadFactory::IThread> Thread_;
};
inline TImpl(TAdaptiveThreadPool* parent, const TParams& params)
@@ -647,8 +647,8 @@ namespace {
THolder<IObjectInQueue> Owned;
public:
- TOwnedObjectInQueue(THolder<IObjectInQueue> owned)
- : Owned(std::move(owned))
+ TOwnedObjectInQueue(THolder<IObjectInQueue> owned)
+ : Owned(std::move(owned))
{
}
@@ -663,12 +663,12 @@ void IThreadPool::SafeAdd(IObjectInQueue* obj) {
Y_ENSURE_EX(Add(obj), TThreadPoolException() << TStringBuf("can not add object to queue"));
}
-void IThreadPool::SafeAddAndOwn(THolder<IObjectInQueue> obj) {
+void IThreadPool::SafeAddAndOwn(THolder<IObjectInQueue> obj) {
Y_ENSURE_EX(AddAndOwn(std::move(obj)), TThreadPoolException() << TStringBuf("can not add to queue and own"));
}
-bool IThreadPool::AddAndOwn(THolder<IObjectInQueue> obj) {
- auto owner = MakeHolder<TOwnedObjectInQueue>(std::move(obj));
+bool IThreadPool::AddAndOwn(THolder<IObjectInQueue> obj) {
+ auto owner = MakeHolder<TOwnedObjectInQueue>(std::move(obj));
bool added = Add(owner.Get());
if (added) {
Y_UNUSED(owner.Release());
diff --git a/util/thread/pool.h b/util/thread/pool.h
index 84e6e694fbc..d1ea3a67cb6 100644
--- a/util/thread/pool.h
+++ b/util/thread/pool.h
@@ -153,7 +153,7 @@ public:
Y_ENSURE_EX(AddFunc(std::forward<T>(func)), TThreadPoolException() << TStringBuf("can not add function to queue"));
}
- void SafeAddAndOwn(THolder<IObjectInQueue> obj);
+ void SafeAddAndOwn(THolder<IObjectInQueue> obj);
/**
* Add object to queue, run ojb->Proccess in other threads.
@@ -173,7 +173,7 @@ public:
return added;
}
- bool AddAndOwn(THolder<IObjectInQueue> obj) Y_WARN_UNUSED_RESULT;
+ bool AddAndOwn(THolder<IObjectInQueue> obj) Y_WARN_UNUSED_RESULT;
virtual void Start(size_t threadCount, size_t queueSizeLimit = 0) = 0;
/** Wait for completion of all scheduled objects, and then exit */
virtual void Stop() noexcept = 0;
@@ -377,7 +377,7 @@ private:
TSlave* Slave_;
};
-inline void Delete(THolder<IThreadPool> q) {
+inline void Delete(THolder<IThreadPool> q) {
if (q.Get()) {
q->Stop();
}
diff --git a/util/thread/pool_ut.cpp b/util/thread/pool_ut.cpp
index 0fa57af1d02..893770d0c47 100644
--- a/util/thread/pool_ut.cpp
+++ b/util/thread/pool_ut.cpp
@@ -24,7 +24,7 @@ struct TThreadPoolTest {
}
void Process(void*) override {
- THolder<TTask> This(this);
+ THolder<TTask> This(this);
TGuard<TSpinLock> guard(Test->Lock);
Test->R ^= Value;