public void Update(string name, int count) { lock (this) { if (counters == null) counters = new Dictionary<string, int>(); if (counters.ContainsKey(name)) counters[name] = counters[name] + count; else counters.Add(name, count); } }