コード例 #1
0
        public AsyncExecutor()
        {
            _resultQueue = new ReaderWriterLockedObject <Queue <IAsyncResult> >(new Queue <IAsyncResult>());
            _waitCount   = new ReaderWriterLockedObject <int>(0);

            _syncContext = SynchronizationContext.Current;
        }
コード例 #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);
        }
コード例 #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (_disposed)
     {
         return;
     }
     if (disposing)
     {
         _collection.Dispose();
         _collection = null;
     }
     _disposed = true;
 }
コード例 #4
0
 public ReaderWriterLockedDictionary()
 {
     _collection = new ReaderWriterLockedObject <Dictionary <TKey, TValue> >(new Dictionary <TKey, TValue>());
 }