[PATCH] D115332: [clang][deps] Use lock_guard instead of unique_lock
Jan Svoboda via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 9 01:43:37 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG58822837cd53: [clang][deps] Use lock_guard instead of unique_lock (authored by jansvoboda11).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115332/new/
https://reviews.llvm.org/D115332
Files:
clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
Index: clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
===================================================================
--- clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
+++ clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
@@ -113,7 +113,7 @@
DependencyScanningFilesystemSharedCache::SharedFileSystemEntry &
DependencyScanningFilesystemSharedCache::SingleCache::get(StringRef Key) {
CacheShard &Shard = CacheShards[llvm::hash_value(Key) % NumShards];
- std::unique_lock<std::mutex> LockGuard(Shard.CacheLock);
+ std::lock_guard<std::mutex> LockGuard(Shard.CacheLock);
auto It = Shard.Cache.try_emplace(Key);
return It.first->getValue();
}
@@ -195,7 +195,7 @@
&SharedCacheEntry = SharedCache.get(Filename, ShouldMinimize);
const CachedFileSystemEntry *Result;
{
- std::unique_lock<std::mutex> LockGuard(SharedCacheEntry.ValueLock);
+ std::lock_guard<std::mutex> LockGuard(SharedCacheEntry.ValueLock);
CachedFileSystemEntry &CacheEntry = SharedCacheEntry.Value;
if (!CacheEntry.isValid()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115332.393069.patch
Type: text/x-patch
Size: 1104 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211209/2d8f18a5/attachment-0001.bin>
More information about the cfe-commits
mailing list