diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-08 08:13:01 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-08 08:15:49 +0000 |
commit | 089e0ecd9d91930dbe7d000b57763f5a77e9af9d (patch) | |
tree | f8960a04093407193a702cdfd312dd1b9db9da87 /vbench | |
parent | 4291a9ec03e9b5b7c23473725678b3c0785cbf91 (diff) |
Use vespalib::Lock -> std::mutex
Diffstat (limited to 'vbench')
-rw-r--r-- | vbench/src/vbench/core/dispatcher.h | 4 | ||||
-rw-r--r-- | vbench/src/vbench/http/http_connection_pool.cpp | 4 | ||||
-rw-r--r-- | vbench/src/vbench/http/http_connection_pool.h | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/vbench/src/vbench/core/dispatcher.h b/vbench/src/vbench/core/dispatcher.h index 212cf04a06e..03e036fe261 100644 --- a/vbench/src/vbench/core/dispatcher.h +++ b/vbench/src/vbench/core/dispatcher.h @@ -36,8 +36,8 @@ private: bool _closed; public: - Dispatcher(Handler<T> &fallback); - ~Dispatcher(); + explicit Dispatcher(Handler<T> &fallback); + ~Dispatcher() override; bool waitForThreads(size_t threads, size_t pollCnt) const; void close() override; void handle(std::unique_ptr<T> obj) override; diff --git a/vbench/src/vbench/http/http_connection_pool.cpp b/vbench/src/vbench/http/http_connection_pool.cpp index ffe6518e374..b949279b7d3 100644 --- a/vbench/src/vbench/http/http_connection_pool.cpp +++ b/vbench/src/vbench/http/http_connection_pool.cpp @@ -19,7 +19,7 @@ HttpConnection::UP HttpConnectionPool::getConnection(const ServerSpec &server) { double now = _timer.sample(); - vespalib::LockGuard guard(_lock); + std::lock_guard guard(_lock); auto res = _map.insert(std::make_pair(server, _store.size())); if (res.second) { _store.emplace_back(); @@ -40,7 +40,7 @@ void HttpConnectionPool::putConnection(HttpConnection::UP conn) { double now = _timer.sample(); - vespalib::LockGuard guard(_lock); + std::lock_guard guard(_lock); conn->touch(now); size_t idx = _map[conn->server()]; assert(idx < _store.size()); diff --git a/vbench/src/vbench/http/http_connection_pool.h b/vbench/src/vbench/http/http_connection_pool.h index 5dd9eb6361c..f5c279e7efe 100644 --- a/vbench/src/vbench/http/http_connection_pool.h +++ b/vbench/src/vbench/http/http_connection_pool.h @@ -5,7 +5,6 @@ #include "http_connection.h" #include <vbench/core/timer.h> #include <vespa/vespalib/util/arrayqueue.hpp> -#include <vespa/vespalib/util/sync.h> #include <map> namespace vbench { @@ -22,7 +21,7 @@ private: typedef std::map<ServerSpec, size_t> Map; using CryptoEngine = vespalib::CryptoEngine; - vespalib::Lock _lock; + std::mutex _lock; Map _map; std::vector<Queue> _store; CryptoEngine::SP _crypto; |