예제 #1
0
        public void EnqueueOperation(BaseDriveOperation operation)
        {
            switch (operation.Type)
            {
            case OperationType.FileTable:
                _highPriorityOperations.Enqueue(operation);
                break;

            case OperationType.Read:
            case OperationType.Write:
                _lowPriorityOperations.Enqueue(operation);
                break;
            }

            lock (_driveAccessLock)
                DriveAccess = DriveAccess.ContinueWith(t => runOperations()).Unwrap();
        }
예제 #2
0
 private async Task runOperation(BaseDriveOperation operation)
 {
     var   task = operation.Run(_drive);
     await task;
 }