diff options
author | dimko <dimko@yandex-team.ru> | 2022-02-10 16:50:07 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:07 +0300 |
commit | 5df1bbceafd25528f800dbe399738150b20384f3 (patch) | |
tree | 9dda05f18a06906442e3deff7861fccc32c2c260 /library/cpp/coroutine | |
parent | a0e29f0026d32a60a618a620f30035c264346175 (diff) | |
download | ydb-5df1bbceafd25528f800dbe399738150b20384f3.tar.gz |
Restoring authorship annotation for <dimko@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/coroutine')
-rw-r--r-- | library/cpp/coroutine/engine/sockpool.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/coroutine/engine/sockpool.h b/library/cpp/coroutine/engine/sockpool.h index 1ebb7e7b38..f15a23003f 100644 --- a/library/cpp/coroutine/engine/sockpool.h +++ b/library/cpp/coroutine/engine/sockpool.h @@ -9,9 +9,9 @@ extern void SetCommonSockOpts(SOCKET sock, const struct sockaddr* sa = nullptr); -class TSocketPool; - -class TPooledSocket { +class TSocketPool; + +class TPooledSocket { class TImpl: public TIntrusiveListItem<TImpl>, public TSimpleRefCount<TImpl, TImpl> { public: TImpl(SOCKET fd, TSocketPool* pool) noexcept @@ -102,7 +102,7 @@ public: ~TPooledSocket() { if (UncaughtException() && !!Impl_) { Close(); - } + } } operator SOCKET() const noexcept { @@ -119,9 +119,9 @@ public: private: TIntrusivePtr<TImpl> Impl_; -}; - -struct TConnectData { +}; + +struct TConnectData { TConnectData(TCont* cont, const TInstant& deadLine) : Cont(cont) , DeadLine(deadLine) @@ -136,9 +136,9 @@ struct TConnectData { TCont* Cont; const TInstant DeadLine; -}; - -class TSocketPool { +}; + +class TSocketPool { friend class TPooledSocket::TImpl; public: @@ -202,8 +202,8 @@ private: if (ret->IsOpen()) { return ret.Release(); - } - } + } + } return nullptr; } @@ -220,12 +220,12 @@ private: using TSockets = TIntrusiveListWithAutoDelete<TPooledSocket::TImpl, TDelete>; TSockets Pool_; TMutex Mutex_; -}; - +}; + inline void TPooledSocket::TImpl::ReturnToPool() noexcept { Pool_->Release(this); -} - +} + class TContIO: public IInputStream, public IOutputStream { public: @@ -250,4 +250,4 @@ public: private: SOCKET Fd_; TCont* Cont_; -}; +}; |