*: use std::scoped_lock with implicit template parameter
This commit is contained in:
@@ -26,7 +26,7 @@ RemoteTagCache::~RemoteTagCache() noexcept
|
||||
void
|
||||
RemoteTagCache::Lookup(const std::string &uri) noexcept
|
||||
{
|
||||
std::unique_lock<Mutex> lock(mutex);
|
||||
std::unique_lock lock{mutex};
|
||||
|
||||
auto [tag, value] = map.insert_check(uri);
|
||||
if (value) {
|
||||
@@ -80,7 +80,7 @@ RemoteTagCache::ItemResolved(Item &item) noexcept
|
||||
void
|
||||
RemoteTagCache::InvokeHandlers() noexcept
|
||||
{
|
||||
const std::scoped_lock<Mutex> lock(mutex);
|
||||
const std::scoped_lock lock{mutex};
|
||||
|
||||
while (!invoke_list.empty()) {
|
||||
auto &item = invoke_list.pop_front();
|
||||
@@ -105,7 +105,7 @@ RemoteTagCache::Item::OnRemoteTag(Tag &&_tag) noexcept
|
||||
|
||||
scanner.reset();
|
||||
|
||||
const std::scoped_lock<Mutex> lock(parent.mutex);
|
||||
const std::scoped_lock lock{parent.mutex};
|
||||
parent.ItemResolved(*this);
|
||||
}
|
||||
|
||||
@@ -117,6 +117,6 @@ RemoteTagCache::Item::OnRemoteTagError(std::exception_ptr e) noexcept
|
||||
|
||||
scanner.reset();
|
||||
|
||||
const std::scoped_lock<Mutex> lock(parent.mutex);
|
||||
const std::scoped_lock lock{parent.mutex};
|
||||
parent.ItemResolved(*this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user