diff options
author | Lutz Bichler <Lutz.Bichler@bmw.de> | 2014-08-19 17:26:40 +0200 |
---|---|---|
committer | Lutz Bichler <Lutz.Bichler@bmw.de> | 2014-08-19 17:26:40 +0200 |
commit | 44d4e23a7d072af09f38fab44af14f5271956574 (patch) | |
tree | ae2a33017ea5e607e474c3d54152b78e1708532a /implementation/routing/src/routing_manager_proxy.cpp | |
parent | c30567ed0ac9dee4dbcef087e75208102d1cbc77 (diff) | |
download | vSomeIP-44d4e23a7d072af09f38fab44af14f5271956574.tar.gz |
Use lock_guard instead of unique_lock where possible (which are all(!)
occurences in the library as we do not use condition variables or
re-locking there).
Adapted formatting of lock statements in the sample code.
Diffstat (limited to 'implementation/routing/src/routing_manager_proxy.cpp')
-rw-r--r-- | implementation/routing/src/routing_manager_proxy.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/implementation/routing/src/routing_manager_proxy.cpp b/implementation/routing/src/routing_manager_proxy.cpp index 21216d1..2419604 100644 --- a/implementation/routing/src/routing_manager_proxy.cpp +++ b/implementation/routing/src/routing_manager_proxy.cpp @@ -204,7 +204,7 @@ bool routing_manager_proxy::send(client_t its_client, bool _flush, bool _reliable) { bool is_sent(false); - std::unique_lock<std::mutex> its_lock(serialize_mutex_); + std::lock_guard<std::mutex> its_lock(serialize_mutex_); if (serializer_->serialize(_message.get())) { is_sent = send(its_client, serializer_->get_data(), serializer_->get_size(), _message->get_instance(), _flush, @@ -225,13 +225,13 @@ bool routing_manager_proxy::send(client_t _client, const byte_t *_data, service_t its_service = VSOMEIP_BYTES_TO_WORD( _data[VSOMEIP_SERVICE_POS_MIN], _data[VSOMEIP_SERVICE_POS_MAX]); - std::unique_lock<std::mutex> its_lock(send_mutex_); + std::lock_guard<std::mutex> its_lock(send_mutex_); its_target = find_local(its_service, _instance); } else { client_t its_client = VSOMEIP_BYTES_TO_WORD( _data[VSOMEIP_CLIENT_POS_MIN], _data[VSOMEIP_CLIENT_POS_MAX]); - std::unique_lock<std::mutex> its_lock(send_mutex_); + std::lock_guard<std::mutex> its_lock(send_mutex_); its_target = find_local(its_client); } |