File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ class ConcurrentHashTableByPtr {
177177
178178#if LLVM_ENABLE_THREADS
179179 // Lock bucket.
180- CurBucket.Guard . lock ( );
180+ std::scoped_lock<std::mutex> Lock ( CurBucket.Guard );
181181#endif
182182
183183 HashesPtr BucketHashes = CurBucket.Hashes ;
@@ -195,11 +195,6 @@ class ConcurrentHashTableByPtr {
195195
196196 CurBucket.NumberOfEntries ++;
197197 RehashBucket (CurBucket);
198-
199- #if LLVM_ENABLE_THREADS
200- CurBucket.Guard .unlock ();
201- #endif
202-
203198 return {NewData, true };
204199 }
205200
@@ -208,10 +203,6 @@ class ConcurrentHashTableByPtr {
208203 KeyDataTy *EntryData = BucketEntries[CurEntryIdx];
209204 if (Info::isEqual (Info::getKey (*EntryData), NewValue)) {
210205 // Already existed entry matched with inserted data is found.
211- #if LLVM_ENABLE_THREADS
212- CurBucket.Guard .unlock ();
213- #endif
214-
215206 return {EntryData, false };
216207 }
217208 }
You can’t perform that action at this time.
0 commit comments