diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-21 12:59:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-21 12:59:22 +0100 |
commit | 958cc2a655735beca465a080e202fdf35b1e0772 (patch) | |
tree | a1d3abba590c8156ff2a9fdd48517911c76c81e3 | |
parent | 41dca6020a82dc938235e192000bbfe6cdb8c100 (diff) | |
parent | c69220b1397c1b02f1e5af99cedebd9f4d70ac61 (diff) |
Merge pull request #25313 from vespa-engine/balder/minor-cleanup-after-adding-lock-to-frtconnection
- Remove lock in destructor.
-rw-r--r-- | config/src/vespa/config/frt/frtconnection.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/config/src/vespa/config/frt/frtconnection.cpp b/config/src/vespa/config/frt/frtconnection.cpp index 466239200d4..be8ccead65c 100644 --- a/config/src/vespa/config/frt/frtconnection.cpp +++ b/config/src/vespa/config/frt/frtconnection.cpp @@ -28,7 +28,6 @@ FRTConnection::FRTConnection(const vespalib::string& address, FRT_Supervisor& su FRTConnection::~FRTConnection() { - std::lock_guard guard(_lock); if (_target != nullptr) { LOG(debug, "Shutting down %s", _address.c_str()); _target->SubRef(); @@ -46,13 +45,16 @@ FRTConnection::getTarget() _target->SubRef(); _target = _supervisor.GetTarget(_address.c_str()); } + _target->AddRef(); return _target; } void FRTConnection::invoke(FRT_RPCRequest * req, duration timeout, FRT_IRequestWait * waiter) { - getTarget()->InvokeAsync(req, vespalib::to_s(timeout), waiter); + FRT_Target * target = getTarget(); + target->InvokeAsync(req, vespalib::to_s(timeout), waiter); + target->SubRef(); } void |