Example #1
0
        SourceEntry GetOrAdd(string source)
        {
            // Serialize access to the dictionary.
            lock (sources)
            {
                SourceEntry entry;
                if (!sources.TryGetValue(source, out entry))
                {
                    entry           = new SourceEntry(source);
                    sources[source] = entry;
                }

                return(entry);
            }
        }