public void Clear () { lock (lockObj) { if (locked) { throw new InvalidOperationException("Atom collection is locked"); } } }