Exemplo n.º 1
0
        private async void DoControllerWork(ITransferController controller)
        {
            this.scheduleSemaphore.Wait();
            bool finished = await controller.DoWorkAsync();

            this.scheduleSemaphore.Release();

            if (finished)
            {
                this.FinishedWorkItem(controller);
            }
        }
Exemplo n.º 2
0
        private async void DoControllerWork(ITransferController controller)
        {
            bool finished = false;

            try
            {
                finished = await controller.DoWorkAsync();
            }
            finally
            {
                Interlocked.Decrement(ref this.ongoingTasks);
            }

            if (finished)
            {
                this.FinishedWorkItem(controller);
            }
        }
        private async void DoControllerWork(ITransferController controller)
        {
            this.scheduleSemaphore.Wait();
            bool finished = await controller.DoWorkAsync();
            this.scheduleSemaphore.Release();

            if (finished)
            {
                this.FinishedWorkItem(controller);
            }
        }