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 | 811ece47d06924d20a94f89d1b0f5cd37254a49c (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/coroutine | |
parent | 5df1bbceafd25528f800dbe399738150b20384f3 (diff) | |
download | ydb-811ece47d06924d20a94f89d1b0f5cd37254a49c.tar.gz |
Restoring authorship annotation for <dimko@yandex-team.ru>. Commit 2 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 f15a23003f..1ebb7e7b38 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_; -}; +}; |