@@ -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 ;
@@ -1043,7 +1040,7 @@ struct ConcurrentReadableHashMap {
1043
1040
// / The return value is ignored when `created` is `false`.
1044
1041
template <class KeyTy , typename Call>
1045
1042
void getOrInsert (KeyTy key, const Call &call) {
1046
- ScopedLockTy guard (WriterLock);
1043
+ typename MutexTy::ScopedLock guard (WriterLock);
1047
1044
1048
1045
auto indices = IndexStorage{Indices.load (std::memory_order_relaxed)};
1049
1046
auto indicesCapacityLog2 = indices.getCapacityLog2 ();
@@ -1092,7 +1089,7 @@ struct ConcurrentReadableHashMap {
1092
1089
// / Clear the hash table, freeing (when safe) all memory currently used for
1093
1090
// / indices and elements.
1094
1091
void clear () {
1095
- ScopedLockTy guard (WriterLock);
1092
+ typename MutexTy::ScopedLock guard (WriterLock);
1096
1093
1097
1094
IndexStorage indices = Indices.load (std::memory_order_relaxed);
1098
1095
auto *elements = Elements.load (std::memory_order_relaxed);
0 commit comments