Prevent using item repositories without locking
Convert struct ItemRepositoryFor into a class to make repo() private in template specializations. Convert itemRepositoryOp() function template into op() static member function inside struct LockedItemRepository. Make LockedItemRepository a friend of each ItemRepositoryFor specialization to ensure that unlocked item repositories are accessed in a single place and prevent accidental access without locking. Add special-purpose safe access functions to the template specializations as needed: to initialize declaration repositories and to let IndexedIdentifier and IndexedQualifiedIdentifier share a mutex.
parent
6c3d9a27
Please register or sign in to comment