EKG_Project.Architecture.ProcessSync.GetGUIMessage C# (CSharp) Method

GetGUIMessage() public method

public GetGUIMessage ( IProcessingState &state, int timeout ) : bool
state IProcessingState
timeout int
return bool
        public bool GetGUIMessage(out IProcessingState state, int timeout = 0)
        {
            int counter = 0;
            while (counter <= timeout)
            {
                if (_toProcessingQueue.Count != 0)
                {
                    state = _toProcessingQueue.Dequeue();
                    return false;
                }
                else
                {
                    counter += 5;
                    Thread.Sleep(5);
                }
            }

            state = null;
            return true;
        }