Mistři v programování na #hovnokod

C# #4658

ako napisat while...

public override void Process(ICommandInputData inputData, bool sendAsap = false)
        {
            _commandsBuffer.Add(new CommandPack{ InputData = inputData, SendAsap = sendAsap });

            ProcessCommands();
        }

        private void ProcessCommands()
        {
            if (_processing == false)
            {
                _processing = true;

                while (true)
                {
                    if (_commandsBuffer.Count > 0)
                    {
                        List<CommandPack> commandsBuffer = _commandsBuffer;
                        _commandsBuffer = new List<CommandPack>();

                        foreach (CommandPack data in commandsBuffer)
                        {
                            ProcessCommand(data);
                        }

                        continue;
                    }

                    break;
                }

                _processing = false;
            }
        }

Anonymous,