diff options
author | udovichenko-r <[email protected]> | 2025-04-21 18:45:07 +0300 |
---|---|---|
committer | udovichenko-r <[email protected]> | 2025-04-21 19:04:53 +0300 |
commit | 313931aa07bc4eac43f483a70122d78a21567078 (patch) | |
tree | ab2c635ebf5de0c6b9cb650ba5389df1b075389d | |
parent | 731eb6bc12b7509ccf4471a360f2b99a2daa45d9 (diff) |
Don't wait Yt poller thread shutdown under lock
commit_hash:1ddf88b71f3418bee4e3621d13b822ef59dc8e9d
-rw-r--r-- | yt/cpp/mapreduce/client/client.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/yt/cpp/mapreduce/client/client.cpp b/yt/cpp/mapreduce/client/client.cpp index c4bb54d1a7d..48ad4a352ea 100644 --- a/yt/cpp/mapreduce/client/client.cpp +++ b/yt/cpp/mapreduce/client/client.cpp @@ -1516,10 +1516,14 @@ TYtPoller& TClient::GetYtPoller() void TClient::Shutdown() { - auto g = Guard(Lock_); - - if (!Shutdown_.exchange(true) && YtPoller_) { - YtPoller_->Stop(); + std::unique_ptr<TYtPoller> poller; + with_lock(Lock_) { + if (!Shutdown_.exchange(true) && YtPoller_) { + poller = std::move(YtPoller_); + } + } + if (poller) { + poller->Stop(); } } |