File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
hardware_interface/include/hardware_interface Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -158,8 +158,7 @@ class Handle
158158private:
159159 void copy (const Handle & other) noexcept
160160 {
161- std::unique_lock<std::shared_mutex> lock (other.handle_mutex_ );
162- std::unique_lock<std::shared_mutex> lock_this (handle_mutex_);
161+ std::scoped_lock lock (other.handle_mutex_ , handle_mutex_);
163162 prefix_name_ = other.prefix_name_ ;
164163 interface_name_ = other.interface_name_ ;
165164 handle_name_ = other.handle_name_ ;
@@ -176,8 +175,7 @@ class Handle
176175
177176 void swap (Handle & first, Handle & second) noexcept
178177 {
179- std::unique_lock<std::shared_mutex> lock (first.handle_mutex_ );
180- std::unique_lock<std::shared_mutex> lock_this (second.handle_mutex_ );
178+ std::scoped_lock lock (first.handle_mutex_ , second.handle_mutex_ );
181179 std::swap (first.prefix_name_ , second.prefix_name_ );
182180 std::swap (first.interface_name_ , second.interface_name_ );
183181 std::swap (first.handle_name_ , second.handle_name_ );
You can’t perform that action at this time.
0 commit comments