The mutex is locked multiple times in sequence (lines 28 and 34), which is inefficient and could lead to lock contention issues. Consider acquiring the lock once at the start of the method and holding it throughout the read operation.
Originally posted by @Copilot in #1559