mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
db::hints:: optimize with_file_update_mutex()
Avoid extra shared_ptr copy. Signed-off-by: Vlad Zolotarov <vladz@scylladb.com> Reviewed-by: Benny Halevy <bhalevy@scylladb.com> Message-Id: <20200311214313.2988-1-vladz@scylladb.com>
This commit is contained in:
committed by
Pekka Enberg
parent
71ac6ebcc5
commit
b83e84b467
@@ -391,8 +391,7 @@ public:
|
||||
/// \return Whatever \ref func returns.
|
||||
template <typename Func>
|
||||
friend inline auto with_file_update_mutex(end_point_hints_manager& ep_man, Func&& func) {
|
||||
lw_shared_ptr<seastar::shared_mutex> lock_ptr = ep_man._file_update_mutex_ptr;
|
||||
return with_lock(*lock_ptr, std::forward<Func>(func)).finally([lock_ptr] {});
|
||||
return with_lock(*ep_man._file_update_mutex_ptr, std::forward<Func>(func)).finally([lock_ptr = ep_man._file_update_mutex_ptr] {});
|
||||
}
|
||||
|
||||
const fs::path& hints_dir() const noexcept {
|
||||
|
||||
Reference in New Issue
Block a user