BaconographyPortable.Services.Impl.SuspendableWorkQueueImpl.RunUIWorkQueue C# (CSharp) Method

RunUIWorkQueue() private method

private RunUIWorkQueue ( ) : void
return void
        private async void RunUIWorkQueue()
        {
            try
            {
                Func<CancellationToken, Task> workUnit = null;
                do
                {
                    lock (_uiInteruptableQueue)
                    {
                        if (_uiInteruptableQueue.Count > 0)
                        {
                            workUnit = _uiInteruptableQueue.Dequeue();
                        }
                        else
                            workUnit = null;
                    }

                    if (workUnit != null)
                    {
                        try
                        {
                            while (HVOCount > 0)
                            {
                                await Task.Delay(100);
                            }

                            await workUnit(_cancelationTokenSource.Token);
                        }
                        catch { }

                    }
                } while (workUnit != null && !_cancelationTokenSource.IsCancellationRequested);
            }
            finally
            {
                _uiTaskQueueRunning = false;
            }
        }