Add a private mutex to the MetadataManager class, and lock it at the start of functions.
Please add an invariant to the MetadataManager destructor that _activeMetadata is either unset or its usageCounter is zero.
Add a private mutex to the MetadataManager class, and lock it at the start of functions.
Please add an invariant to the MetadataManager destructor that _activeMetadata is either unset or its usageCounter is zero.