diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/coroutine | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/coroutine')
-rw-r--r-- | library/cpp/coroutine/engine/coroutine_ut.cpp | 28 | ||||
-rw-r--r-- | library/cpp/coroutine/engine/impl.h | 2 | ||||
-rw-r--r-- | library/cpp/coroutine/engine/poller.cpp | 10 | ||||
-rw-r--r-- | library/cpp/coroutine/engine/sockmap.h | 4 | ||||
-rw-r--r-- | library/cpp/coroutine/engine/sockpool.h | 4 | ||||
-rw-r--r-- | library/cpp/coroutine/listener/listen.cpp | 24 | ||||
-rw-r--r-- | library/cpp/coroutine/listener/listen.h | 16 |
7 files changed, 44 insertions, 44 deletions
diff --git a/library/cpp/coroutine/engine/coroutine_ut.cpp b/library/cpp/coroutine/engine/coroutine_ut.cpp index fcc9a5a641..8b372496a2 100644 --- a/library/cpp/coroutine/engine/coroutine_ut.cpp +++ b/library/cpp/coroutine/engine/coroutine_ut.cpp @@ -125,11 +125,11 @@ void TCoroTest::TestException() { UNIT_ASSERT(!unc); } -static int i0; +static int i0; static void CoRun(TCont* c, void* /*run*/) { - while (i0 < 100000) { - ++i0; + while (i0 < 100000) { + ++i0; UNIT_ASSERT(RunningCont() == c); c->Yield(); UNIT_ASSERT(RunningCont() == c); @@ -137,7 +137,7 @@ static void CoRun(TCont* c, void* /*run*/) { } static void CoMain(TCont* c, void* /*arg*/) { - for (volatile size_t i2 = 0; i2 < 10; ++i2) { + for (volatile size_t i2 = 0; i2 < 10; ++i2) { UNIT_ASSERT(RunningCont() == c); c->Executor()->Create(CoRun, nullptr, "run"); UNIT_ASSERT(RunningCont() == c); @@ -192,7 +192,7 @@ public: }; void TCoroTest::TestMemFun() { - i0 = 0; + i0 = 0; TContExecutor e(32000); TTestObject obj; e.Create<TTestObject, &TTestObject::RunTask1>(&obj, "test1"); @@ -203,25 +203,25 @@ void TCoroTest::TestMemFun() { void TCoroTest::TestSimpleX2() { { - i0 = 0; + i0 = 0; { TContExecutor e(32000); e.Execute(CoMain); } - UNIT_ASSERT_EQUAL(i0, 100000); + UNIT_ASSERT_EQUAL(i0, 100000); } { - i0 = 0; + i0 = 0; { TContExecutor e(32000); e.Execute(CoMain); } - UNIT_ASSERT_EQUAL(i0, 100000); + UNIT_ASSERT_EQUAL(i0, 100000); } } @@ -243,7 +243,7 @@ void TCoroTest::TestSimpleX3() { TContExecutor e(32000); TRunner runner; - for (volatile size_t i3 = 0; i3 < 1000; ++i3) { + for (volatile size_t i3 = 0; i3 < 1000; ++i3) { e.Create(runner, "runner"); } @@ -252,7 +252,7 @@ void TCoroTest::TestSimpleX3() { UNIT_ASSERT_EQUAL(runner.Runs, 1000); } -static TString res; +static TString res; static TContMutex mutex; static void CoMutex(TCont* c, void* /*run*/) { @@ -289,7 +289,7 @@ static TContMutex m1; static TContCondVar c1; static void CoCondVar(TCont* c, void* /*run*/) { - for (size_t i4 = 0; i4 < 3; ++i4) { + for (size_t i4 = 0; i4 < 3; ++i4) { UNIT_ASSERT_EQUAL(m1.LockI(c), 0); UNIT_ASSERT_EQUAL(c1.WaitI(c, &m1), 0); res += c->Name(); @@ -311,8 +311,8 @@ static void CoCondVarTest(TCont* c, void* /*run*/) { c->Executor()->Create(CoCondVar, nullptr, "6"); c->Yield(); - for (size_t i5 = 0; i5 < 3; ++i5) { - res += ToString((size_t)i5) + "^"; + for (size_t i5 = 0; i5 < 3; ++i5) { + res += ToString((size_t)i5) + "^"; c1.BroadCast(); c->Yield(); } diff --git a/library/cpp/coroutine/engine/impl.h b/library/cpp/coroutine/engine/impl.h index 0abfa5582c..283a96ecf1 100644 --- a/library/cpp/coroutine/engine/impl.h +++ b/library/cpp/coroutine/engine/impl.h @@ -160,7 +160,7 @@ public: NCoro::ITime* time = nullptr ); - ~TContExecutor(); + ~TContExecutor(); // if we already have a coroutine to run void Execute() noexcept; diff --git a/library/cpp/coroutine/engine/poller.cpp b/library/cpp/coroutine/engine/poller.cpp index 73398d8e65..61164fa56b 100644 --- a/library/cpp/coroutine/engine/poller.cpp +++ b/library/cpp/coroutine/engine/poller.cpp @@ -128,11 +128,11 @@ namespace { } }; - typedef TIntrusiveList<TVal> TListType; + typedef TIntrusiveList<TVal> TListType; public: - typedef typename TListType::TIterator TIterator; - typedef typename TListType::TConstIterator TConstIterator; + typedef typename TListType::TIterator TIterator; + typedef typename TListType::TConstIterator TConstIterator; TIndexedArray() : P_(TMemoryPool::TExpGrow::Instance(), TDefaultAllocator::Instance()) @@ -184,7 +184,7 @@ namespace { using TValRef = THolder<TVal>; typename TVal::TPool P_; TSocketMap<TValRef> V_; - TListType I_; + TListType I_; }; @@ -306,7 +306,7 @@ namespace { private: typedef TIndexedArray<TChange> TFds; TFds S_; - typedef TVector<pollfd> TPollVec; + typedef TVector<pollfd> TPollVec; TPollVec T_; }; diff --git a/library/cpp/coroutine/engine/sockmap.h b/library/cpp/coroutine/engine/sockmap.h index 193ec2261b..fd189e1774 100644 --- a/library/cpp/coroutine/engine/sockmap.h +++ b/library/cpp/coroutine/engine/sockmap.h @@ -19,6 +19,6 @@ public: } private: - TVector<T> V_; - THashMap<size_t, T> H_; + TVector<T> V_; + THashMap<size_t, T> H_; }; diff --git a/library/cpp/coroutine/engine/sockpool.h b/library/cpp/coroutine/engine/sockpool.h index 953f4f600c..1ebb7e7b38 100644 --- a/library/cpp/coroutine/engine/sockpool.h +++ b/library/cpp/coroutine/engine/sockpool.h @@ -77,7 +77,7 @@ class TPooledSocket { } private: - inline void ReturnToPool() noexcept; + inline void ReturnToPool() noexcept; private: TSocketPool* Pool_; @@ -222,7 +222,7 @@ private: TMutex Mutex_; }; -inline void TPooledSocket::TImpl::ReturnToPool() noexcept { +inline void TPooledSocket::TImpl::ReturnToPool() noexcept { Pool_->Release(this); } diff --git a/library/cpp/coroutine/listener/listen.cpp b/library/cpp/coroutine/listener/listen.cpp index 58795e07e4..3d4e711d1d 100644 --- a/library/cpp/coroutine/listener/listen.cpp +++ b/library/cpp/coroutine/listener/listen.cpp @@ -16,12 +16,12 @@ namespace { const sockaddr_in* In; const sockaddr_in6* In6; - inline TSa(const sockaddr* sa) noexcept + inline TSa(const sockaddr* sa) noexcept : Sa(sa) { } - inline bool operator==(const TSa& r) const noexcept { + inline bool operator==(const TSa& r) const noexcept { if (Sa->sa_family == r.Sa->sa_family) { switch (Sa->sa_family) { case AF_INET: @@ -34,7 +34,7 @@ namespace { return false; } - inline bool operator!=(const TSa& r) const noexcept { + inline bool operator!=(const TSa& r) const noexcept { return !(*this == r); } }; @@ -43,7 +43,7 @@ namespace { class TContListener::TImpl { private: struct TStoredAddrInfo: public TAddrInfo, private TNetworkAddress { - inline TStoredAddrInfo(const struct addrinfo* ai, const TNetworkAddress& addr) noexcept + inline TStoredAddrInfo(const struct addrinfo* ai, const TNetworkAddress& addr) noexcept : TAddrInfo(ai) , TNetworkAddress(addr) { @@ -84,12 +84,12 @@ private: } } - inline ~TOneSocketListener() { + inline ~TOneSocketListener() { Stop(); } public: - inline void Run(TCont* cont) noexcept { + inline void Run(TCont* cont) noexcept { C_ = cont; DoRun(); C_ = nullptr; @@ -111,11 +111,11 @@ private: } } - inline const IRemoteAddr* Addr() const noexcept { + inline const IRemoteAddr* Addr() const noexcept { return Addr_.Get(); } - inline void Stop() noexcept { + inline void Stop() noexcept { if (C_) { C_->Cancel(); @@ -126,7 +126,7 @@ private: } private: - inline void DoRun() noexcept { + inline void DoRun() noexcept { while (!C_->Cancelled()) { try { TOpaqueAddr remote; @@ -208,7 +208,7 @@ private: }; public: - inline TImpl(ICallBack* cb, TContExecutor* e, const TOptions& opts) noexcept + inline TImpl(ICallBack* cb, TContExecutor* e, const TOptions& opts) noexcept : E_(e) , Cb_(cb) , Opts_(opts) @@ -274,7 +274,7 @@ TContListener::TContListener(ICallBack* cb, TContExecutor* e, const TOptions& op { } -TContListener::~TContListener() { +TContListener::~TContListener() { } namespace { @@ -315,7 +315,7 @@ void TContListener::Bind(const TNetworkAddress& addr) { CheckImpl(Impl_)->Bind(addr); } -void TContListener::Stop() noexcept { +void TContListener::Stop() noexcept { Impl_.Destroy(); } diff --git a/library/cpp/coroutine/listener/listen.h b/library/cpp/coroutine/listener/listen.h index 22d3da85f3..3a89cd3ecc 100644 --- a/library/cpp/coroutine/listener/listen.h +++ b/library/cpp/coroutine/listener/listen.h @@ -15,7 +15,7 @@ namespace NAddr { class TContListener { public: struct TOptions { - inline TOptions() noexcept + inline TOptions() noexcept : ListenQueue(Max<size_t>()) , SendBufSize(0) , RecvBufSize(0) @@ -24,31 +24,31 @@ public: { } - inline TOptions& SetListenQueue(size_t len) noexcept { + inline TOptions& SetListenQueue(size_t len) noexcept { ListenQueue = len; return *this; } - inline TOptions& SetDeferAccept(bool enable) noexcept { + inline TOptions& SetDeferAccept(bool enable) noexcept { EnableDeferAccept = enable; return *this; } - inline TOptions& SetSendBufSize(unsigned size) noexcept { + inline TOptions& SetSendBufSize(unsigned size) noexcept { SendBufSize = size; return *this; } - inline TOptions& SetRecvBufSize(unsigned size) noexcept { + inline TOptions& SetRecvBufSize(unsigned size) noexcept { RecvBufSize = size; return *this; } - inline TOptions& SetReusePort(bool reusePort) noexcept { + inline TOptions& SetReusePort(bool reusePort) noexcept { ReusePort = reusePort; return *this; @@ -93,7 +93,7 @@ public: }; TContListener(ICallBack* cb, TContExecutor* e, const TOptions& opts = TOptions()); - ~TContListener(); + ~TContListener(); /// start listener threads void Listen(); @@ -107,7 +107,7 @@ public: void Bind(const TIpAddress& addr); void Bind(const TNetworkAddress& addr); - void Stop() noexcept; + void Stop() noexcept; void StopListenAddr(const NAddr::IRemoteAddr& addr); void StopListenAddr(const TIpAddress& addr); |