Exemple #1
0
        public AsyncExecutor()
        {
            _resultQueue = new ReaderWriterLockedObject <Queue <IAsyncResult> >(new Queue <IAsyncResult>());
            _waitCount   = new ReaderWriterLockedObject <int>(0);

            _syncContext = SynchronizationContext.Current;
        }
Exemple #2
0
        public ReaderWriterLockedDictionary(IEnumerable <KeyValuePair <TKey, TValue> > keyValuePairs)
        {
            var dictionary = new Dictionary <TKey, TValue>();

            foreach (KeyValuePair <TKey, TValue> pair in keyValuePairs)
            {
                dictionary.Add(pair.Key, pair.Value);
            }

            _collection = new ReaderWriterLockedObject <Dictionary <TKey, TValue> >(dictionary);
        }
Exemple #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (_disposed)
     {
         return;
     }
     if (disposing)
     {
         _collection.Dispose();
         _collection = null;
     }
     _disposed = true;
 }
Exemple #4
0
 public ReaderWriterLockedDictionary()
 {
     _collection = new ReaderWriterLockedObject <Dictionary <TKey, TValue> >(new Dictionary <TKey, TValue>());
 }