/// <summary>
/// Checks if gdb is ready and sends the next command
/// </summary>
private void ProcessQueue()
{
lock (_commands)
{
if (_commands.Count == 0 || _gdbReadyForInput == false)
return;
_gdbReadyForInput = false;
WriteLine (_commands.Peek ().Command);
_currentCommand = _commands.Dequeue ();
//If no response handler is specified, we don't need the command anymore
if (_currentCommand.ResponseHandler == null)
{
_currentCommand.CommandFinished ();
_currentCommand = null;
}
}
}