aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/neh
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2023-11-22 11:00:23 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2023-11-22 12:13:22 +0300
commit66db06bedee4e8d3c539464ab85d8413c3c0b539 (patch)
tree0e0d2a6aeb36c45793c22bd9cefc200ddc095a5a /library/cpp/neh
parent4fbe60cb421e9b6db948035286ce602e1c2627c8 (diff)
downloadydb-66db06bedee4e8d3c539464ab85d8413c3c0b539.tar.gz
Intermediate changes
Diffstat (limited to 'library/cpp/neh')
-rw-r--r--library/cpp/neh/asio/asio.cpp4
-rw-r--r--library/cpp/neh/asio/asio.h3
-rw-r--r--library/cpp/neh/asio/io_service_impl.h4
3 files changed, 11 insertions, 0 deletions
diff --git a/library/cpp/neh/asio/asio.cpp b/library/cpp/neh/asio/asio.cpp
index 8b6cf383ea..e10f62f575 100644
--- a/library/cpp/neh/asio/asio.cpp
+++ b/library/cpp/neh/asio/asio.cpp
@@ -35,6 +35,10 @@ namespace NAsio {
Impl_->Run();
}
+ size_t TIOService::GetOpQueueSize() noexcept {
+ return Impl_->GetOpQueueSize();
+ }
+
void TIOService::Post(TCompletionHandler h) {
Impl_->Post(std::move(h));
}
diff --git a/library/cpp/neh/asio/asio.h b/library/cpp/neh/asio/asio.h
index a902d663cf..87c3c6d525 100644
--- a/library/cpp/neh/asio/asio.h
+++ b/library/cpp/neh/asio/asio.h
@@ -105,6 +105,9 @@ namespace NAsio {
void Post(TCompletionHandler); //call handler in Run() thread-executor
void Abort(); //in Run() all exist async i/o operations + timers receive error = ECANCELED, Run() exited
+ // not const since internal queue is lockfree and needs to increment and decrement its reference counters
+ size_t GetOpQueueSize() noexcept;
+
//counterpart boost::asio::io_service::work
class TWork {
public:
diff --git a/library/cpp/neh/asio/io_service_impl.h b/library/cpp/neh/asio/io_service_impl.h
index 687b5576e8..e1768df6d9 100644
--- a/library/cpp/neh/asio/io_service_impl.h
+++ b/library/cpp/neh/asio/io_service_impl.h
@@ -492,6 +492,10 @@ namespace NAsio {
}
}
+ inline size_t GetOpQueueSize() noexcept {
+ return OpQueue_.Size();
+ }
+
void SyncRegisterTimer(TTimer* t) {
Timers_.insert(t);
}