Flush() private method

private Flush ( ) : void
return void
示例#1
0
 public void Write(Action <StorageActionsAccessor> func)
 {
     lock (locker)
     {
         using (var reader = OpenReader())
         {
             var mutator  = new StorageMutator(writer, reader, transaction);
             var viewer   = new StorageReader(reader, transaction);
             var accessor = new StorageActionsAccessor(mutator, viewer, reader, writer);
             func(accessor);
             mutator.Flush();
             var storageTransaction = mutator.CreateTransaction();
             if (transaction.Equals(storageTransaction))
             {
                 return;
             }
             WriteTransaction(storageTransaction);
             writer.Flush(true);
             transaction = storageTransaction;
             accessor.RaiseCommitEvent();
             if (onCommit != null)
             {
                 onCommit();
             }
         }
     }
 }
		public void Write(Action<StorageActionsAccessor> func)
		{
			lock (locker)
			{
				using (var reader = OpenReader())
				{
					var mutator = new StorageMutator(writer, reader, transaction);
					var viewer = new StorageReader(reader, transaction);
					var accessor = new StorageActionsAccessor(mutator, viewer, reader, writer);
					func(accessor);
					mutator.Flush();
					var storageTransaction = mutator.CreateTransaction();
					if (transaction.Equals(storageTransaction))
						return;
					WriteTransaction(storageTransaction);
					writer.Flush(true);
					transaction = storageTransaction;
					accessor.RaiseCommitEvent();
					if (onCommit != null)
						onCommit();
				}
			}
		}