private static InnerLock AcquireLock([NotNull] object key) { lock (Locks) { if (!Locks.ContainsKey(key)) { Locks[key] = new InnerLock(); } return(Locks[key]); } }