*: use std::scoped_lock with implicit template parameter

This commit is contained in:
Max Kellermann
2024-05-23 20:43:31 +02:00
parent 4fc3230fe6
commit 381215fd73
68 changed files with 253 additions and 253 deletions

View File

@@ -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);
}