@@ -508,8 +508,8 @@ template <class ElemTy> struct ConcurrentReadableArray {
508
508
}
509
509
510
510
void push_back (const ElemTy &elem) {
511
- ScopedLock guard (WriterLock);
512
-
511
+ Mutex:: ScopedLock guard (WriterLock);
512
+
513
513
auto *storage = Elements.load (std::memory_order_relaxed);
514
514
auto count = storage ? storage->Count .load (std::memory_order_relaxed) : 0 ;
515
515
if (count >= Capacity) {
@@ -594,9 +594,6 @@ struct ConcurrentReadableHashMap {
594
594
" Elements must not have destructors (they won't be called)." );
595
595
596
596
private:
597
- // A scoped lock type to use on MutexTy.
598
- using ScopedLockTy = ScopedLockT<MutexTy, false >;
599
-
600
597
// / The reciprocal of the load factor at which we expand the table. A value of
601
598
// / 4 means that we resize at 1/4 = 75% load factor.
602
599
static const size_t ResizeProportion = 4 ;
@@ -970,7 +967,7 @@ struct ConcurrentReadableHashMap {
970
967
// / The return value is ignored when `created` is `false`.
971
968
template <class KeyTy , typename Call>
972
969
void getOrInsert (KeyTy key, const Call &call) {
973
- ScopedLockTy guard (WriterLock);
970
+ typename MutexTy::ScopedLock guard (WriterLock);
974
971
975
972
auto *indices = Indices.load (std::memory_order_relaxed);
976
973
if (!indices)
@@ -1022,7 +1019,7 @@ struct ConcurrentReadableHashMap {
1022
1019
// / Clear the hash table, freeing (when safe) all memory currently used for
1023
1020
// / indices and elements.
1024
1021
void clear () {
1025
- ScopedLockTy guard (WriterLock);
1022
+ typename MutexTy::ScopedLock guard (WriterLock);
1026
1023
1027
1024
auto *indices = Indices.load (std::memory_order_relaxed);
1028
1025
auto *elements = Elements.load (std::memory_order_relaxed);
0 commit comments